mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 03:27:40 +01:00
Revert commit ddfb90a0a194d6b9acce20da555fab2cfa898171, and always delete files from disk rather than sending them to trash.
This commit is contained in:
parent
a8d9f9104a
commit
1d098a40b8
@ -15,20 +15,9 @@
|
|||||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "filesystemmusicstorage.h"
|
||||||
#include "core/logging.h"
|
#include "core/logging.h"
|
||||||
|
|
||||||
#ifdef HAVE_GIO
|
|
||||||
// Work around compile issue with glib >= 2.25
|
|
||||||
#ifdef signals
|
|
||||||
#undef signals
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gio/gio.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "filesystemmusicstorage.h"
|
|
||||||
#include <QByteArray>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
@ -64,16 +53,5 @@ bool FilesystemMusicStorage::CopyToStorage(const CopyJob& job) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool FilesystemMusicStorage::DeleteFromStorage(const DeleteJob& job) {
|
bool FilesystemMusicStorage::DeleteFromStorage(const DeleteJob& job) {
|
||||||
#ifdef HAVE_GIO
|
|
||||||
//convert QString to char
|
|
||||||
QByteArray ba = job.metadata_.url().toLocalFile().toLocal8Bit();
|
|
||||||
const char *filepathChar = ba.data();
|
|
||||||
GFile *file = g_file_new_for_path (filepathChar);
|
|
||||||
bool success = g_file_trash(file, NULL, NULL);
|
|
||||||
g_object_unref(file);
|
|
||||||
return success;
|
|
||||||
#else
|
|
||||||
return QFile::remove(job.metadata_.url().toLocalFile());
|
return QFile::remove(job.metadata_.url().toLocalFile());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user