mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 11:19:18 +01:00
Filter out trashed/hidden folders on the server.
This commit is contained in:
parent
e06ae8a282
commit
fc61f0627f
@ -39,8 +39,9 @@ FolderModel::FolderModel(Client* client, QObject* parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FolderModel::Refresh() {
|
void FolderModel::Refresh() {
|
||||||
ListFilesResponse* reply =
|
ListFilesResponse* reply = client_->ListFiles(
|
||||||
client_->ListFiles(QString("mimeType = '%1'").arg(File::kFolderMimeType));
|
QString("mimeType = '%1' and trashed = false and hidden = false")
|
||||||
|
.arg(File::kFolderMimeType));
|
||||||
connect(reply, SIGNAL(FilesFound(QList<google_drive::File>)),
|
connect(reply, SIGNAL(FilesFound(QList<google_drive::File>)),
|
||||||
this, SLOT(FilesFound(QList<google_drive::File>)));
|
this, SLOT(FilesFound(QList<google_drive::File>)));
|
||||||
NewClosure(reply, SIGNAL(Finished()),
|
NewClosure(reply, SIGNAL(Finished()),
|
||||||
@ -54,10 +55,6 @@ void FolderModel::FindFilesFinished(ListFilesResponse* reply) {
|
|||||||
|
|
||||||
void FolderModel::FilesFound(const QList<google_drive::File>& files) {
|
void FolderModel::FilesFound(const QList<google_drive::File>& files) {
|
||||||
foreach (const File& file, files) {
|
foreach (const File& file, files) {
|
||||||
if (file.is_hidden() || file.is_trashed()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString id(file.id());
|
const QString id(file.id());
|
||||||
|
|
||||||
// Does this file exist in the model already?
|
// Does this file exist in the model already?
|
||||||
|
Loading…
Reference in New Issue
Block a user