diff options
Diffstat (limited to 'src/downloadmanager.h')
| -rw-r--r-- | src/downloadmanager.h | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/downloadmanager.h b/src/downloadmanager.h index 07219f08..623dda7a 100644 --- a/src/downloadmanager.h +++ b/src/downloadmanager.h @@ -70,7 +70,8 @@ public: STATE_FETCHINGMODINFO, STATE_FETCHINGFILEINFO, STATE_READY, - STATE_INSTALLED + STATE_INSTALLED, + STATE_UNINSTALLED }; private: @@ -150,6 +151,11 @@ public: QString getOutputDirectory() const { return m_OutputDirectory; } /** + * @brief setPreferredServers set the list of preferred servers + */ + void setPreferredServers(const std::map<QString, int> &preferredServers); + + /** * @brief set the list of supported extensions * @param extensions list of supported extensions */ @@ -251,6 +257,13 @@ public: void markInstalled(int index); /** + * @brief mark a download as uninstalled + * + * @param index index of the file to mark uninstalled + */ + void markUninstalled(int index); + + /** * @brief refreshes the list of downloads */ void refreshList(); @@ -261,13 +274,20 @@ public: * @param RHS * @return */ - static bool ServerByPreference(const QVariant &LHS, const QVariant &RHS); + static bool ServerByPreference(const std::map<QString, int> &preferredServers, const QVariant &LHS, const QVariant &RHS); virtual int startDownloadURLs(const QStringList &urls); virtual int startDownloadNexusFile(int modID, int fileID); virtual QString downloadPath(int id); + /** + * @brief retrieve a download index from the filename + * @param fileName file to look up + * @return index of that download or -1 if it wasn't found + */ + int indexByName(const QString &fileName) const; + signals: void aboutToUpdate(); @@ -286,6 +306,13 @@ signals: **/ void showMessage(const QString &message); + /** + * @brief emitted whenever the state of a download changes + * @param row the row that changed + * @param state the new state + */ + void stateChanged(int row, DownloadManager::DownloadState state); + public slots: /** @@ -371,6 +398,7 @@ private: QVector<DownloadInfo*> m_ActiveDownloads; QString m_OutputDirectory; + std::map<QString, int> m_PreferredServers; QStringList m_SupportedExtensions; std::set<int> m_RequestIDs; QVector<int> m_AlphabeticalTranslation; |
