diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2018-03-27 13:17:29 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-06-05 09:12:58 +0300 |
commit | f4f228de3e39ea5e4c0d9a6821ced84d43650449 (patch) | |
tree | c119829f3f5490c283c17aaabb3191760f385dae /src/gui/folderstatusmodel.h | |
parent | 6872cbda7e65bf86800f1e9849f8aa51264a01f0 (diff) |
FolderStatusModel: fix potential assert
OCC::FolderStatusModel::slotUpdateDirectories: ASSERT: "parentInfo->_fetching" in file /home/olivier/kdegit/owncloud/mirall/src/gui/folderstatusmodel.cpp, line 599
This can happen if the structure of a folder is change while the user
expands the root folder. In this case, resetSubs() is called which
resets _fetching to false.
Instead, we need to keep a pointer to the job so we can abort it by
deleting it.
Diffstat (limited to 'src/gui/folderstatusmodel.h')
-rw-r--r-- | src/gui/folderstatusmodel.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/folderstatusmodel.h b/src/gui/folderstatusmodel.h index 4de1451f9..30334d569 100644 --- a/src/gui/folderstatusmodel.h +++ b/src/gui/folderstatusmodel.h @@ -20,6 +20,7 @@ #include <QLoggingCategory> #include <QVector> #include <QElapsedTimer> +#include <QPointer> class QNetworkReply; namespace OCC { @@ -28,6 +29,7 @@ Q_DECLARE_LOGGING_CATEGORY(lcFolderStatus) class Folder; class ProgressInfo; +class LsColJob; /** * @brief The FolderStatusModel class @@ -61,7 +63,6 @@ public: , _size(0) , _isExternal(false) , _fetched(false) - , _fetching(false) , _hasError(false) , _fetchingLabel(false) , _isUndecided(false) @@ -77,7 +78,7 @@ public: bool _isExternal; bool _fetched; // If we did the LSCOL for this folder already - bool _fetching; // Whether a LSCOL job is currently running + QPointer<LsColJob> _fetchingJob; // Currently running LsColJob bool _hasError; // If the last fetching job ended in an error QString _lastErrorString; bool _fetchingLabel; // Whether a 'fetching in progress' label is shown. |