diff options
| -rw-r--r-- | gui/remotebrowser.cpp | 1 | ||||
| -rw-r--r-- | gui/remotebrowser.h | 10 | 
2 files changed, 11 insertions, 0 deletions
diff --git a/gui/remotebrowser.cpp b/gui/remotebrowser.cpp index efeabb69a6..e8921b905a 100644 --- a/gui/remotebrowser.cpp +++ b/gui/remotebrowser.cpp @@ -201,6 +201,7 @@ void RemoteBrowserDialog::directoryListedCallback(Cloud::Storage::ListDirectoryR  	_navigationLocked = false;  	_nodeContent = response.value; +	Common::sort(_nodeContent.begin(), _nodeContent.end(), FileListOrder());  	_updateList = true;  } diff --git a/gui/remotebrowser.h b/gui/remotebrowser.h index 0137c32dc0..be416154a1 100644 --- a/gui/remotebrowser.h +++ b/gui/remotebrowser.h @@ -66,6 +66,16 @@ protected:  	void listDirectory(Cloud::StorageFile node);  	void directoryListedCallback(Cloud::Storage::ListDirectoryResponse response);  	void directoryListedErrorCallback(Networking::ErrorResponse error); + +	struct FileListOrder : public Common::BinaryFunction<Cloud::StorageFile, Cloud::StorageFile, bool> { +		bool operator()(const Cloud::StorageFile &x, const Cloud::StorageFile &y) const { +			if (x.isDirectory() != y.isDirectory()) { +				return x.isDirectory(); //x < y (directory < not directory) or x > y (not directory > directory) +			} + +			return x.name() < y.name(); +		} +	};  };  } // End of namespace GUI  | 
