Disable some code that needs lambda with old GCC
authorOlivier Goffart <ogoffart@woboq.com>
Tue, 1 Dec 2015 09:30:11 +0000 (10:30 +0100)
committerOlivier Goffart <ogoffart@woboq.com>
Tue, 1 Dec 2015 09:30:11 +0000 (10:30 +0100)
It's just a feature that was not there in 2.0
It means that removed folder stay on the undecided list if it is removed
from the server until the user press apply in the selective sync widget.
Not a very bad bug anyway.

src/gui/folderstatusmodel.cpp

index d169765a7dd451ee044017485344d9895fb96383..14d0bf19040b50d33d6e19ee7ef47ef7243ca02f 100644 (file)
@@ -625,6 +625,10 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list)
         suggestExpand(idx.child(*it, 0));
     }
 
+    /* We need lambda function for the following code.
+     * It's just a small feature that will be missing if the comiler is too old */
+#if !(defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 405)
+
     /* Try to remove the the undecided lists the items that are not on the server. */
     auto it = std::remove_if(selectiveSyncUndecidedList.begin(), selectiveSyncUndecidedList.end(),
             [&](const QString &s) { return selectiveSyncUndecidedSet.count(s); } );
@@ -634,6 +638,7 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list)
                             SyncJournalDb::SelectiveSyncUndecidedList, selectiveSyncUndecidedList);
         emit dirtyChanged();
     }
+#endif
 }
 
 void FolderStatusModel::slotLscolFinishedWithError(QNetworkReply* r)