summaryrefslogtreecommitdiff
path: root/src/downloadmanager.h
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-06-29 18:04:10 +0200
committerTannin <devnull@localhost>2013-06-29 18:04:10 +0200
commitfe37b48dffd8edcd6e30f4e304d3e27a731ac8ae (patch)
treee996c5d329d9abf77bcd12af4d05238fd6ebca1f /src/downloadmanager.h
parentf8c683f700a3fff30540ff343df2bfba15080e86 (diff)
- 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
Diffstat (limited to 'src/downloadmanager.h')
-rw-r--r--src/downloadmanager.h32
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;