From fe37b48dffd8edcd6e30f4e304d3e27a731ac8ae Mon Sep 17 00:00:00 2001 From: Tannin Date: Sat, 29 Jun 2013 18:04:10 +0200 Subject: - caching of downloadwidgets to fix performance problem, currently broken and disabled - added new state for downloads "uninstalled" for mods that were at one point installed and then removed - user-configured server preference is now used - updated tutorial to account for removal of integrated browser - reverted to qt 4 - using performance optimised findfirstfile on win vista and up - bugfix: it was possible to disable all columns of the mod list - bugfix: hook.dll doesn't load on win xp --- src/downloadmanager.h | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'src/downloadmanager.h') 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: @@ -149,6 +150,11 @@ public: **/ QString getOutputDirectory() const { return m_OutputDirectory; } + /** + * @brief setPreferredServers set the list of preferred servers + */ + void setPreferredServers(const std::map &preferredServers); + /** * @brief set the list of supported extensions * @param extensions list of supported extensions @@ -250,6 +256,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 */ @@ -261,13 +274,20 @@ public: * @param RHS * @return */ - static bool ServerByPreference(const QVariant &LHS, const QVariant &RHS); + static bool ServerByPreference(const std::map &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 m_ActiveDownloads; QString m_OutputDirectory; + std::map m_PreferredServers; QStringList m_SupportedExtensions; std::set m_RequestIDs; QVector m_AlphabeticalTranslation; -- cgit v1.3.1