summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.h22
-rw-r--r--src/modinfo.cpp5
-rw-r--r--src/modinfo.h15
3 files changed, 41 insertions, 1 deletions
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 7d5d4a63..dc8d20c8 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -60,6 +60,7 @@ class QToolButton;
class ModListSortProxy;
class ModListGroupCategoriesProxy;
+
class MainWindow : public QMainWindow, public MOBase::IOrganizer, public MOBase::IPluginDiagnose
{
Q_OBJECT
@@ -88,6 +89,26 @@ public:
typedef boost::signals2::signal<bool (const QString&), SignalCombinerAnd> SignalAboutToRunApplication;
public:
+
+ struct SignalCombinerAnd
+ {
+ typedef bool result_type;
+ template<typename InputIterator>
+ bool operator()(InputIterator first, InputIterator last) const
+ {
+ while (first != last) {
+ if (!(*first)) {
+ return false;
+ }
+ ++first;
+ }
+ return true;
+ }
+ };
+
+ typedef boost::signals2::signal<bool (const QString&), SignalCombinerAnd> SignalAboutToRunApplication;
+
+public:
explicit MainWindow(const QString &exeName, QSettings &initSettings, QWidget *parent = 0);
~MainWindow();
@@ -180,7 +201,6 @@ signals:
void styleChanged(const QString &styleFile);
-
void modListDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
protected:
diff --git a/src/modinfo.cpp b/src/modinfo.cpp
index 1479f7b4..9bc013f1 100644
--- a/src/modinfo.cpp
+++ b/src/modinfo.cpp
@@ -554,6 +554,11 @@ void ModInfoRegular::setNexusDescription(const QString &description)
m_MetaInfoChanged = true;
}
+void ModInfoRegular::addNexusCategory(int categoryID)
+{
+ m_Categories.insert(CategoryFactory::instance().resolveNexusID(categoryID));
+}
+
void ModInfoRegular::setIsEndorsed(bool endorsed)
{
diff --git a/src/modinfo.h b/src/modinfo.h
index 3b83d207..e408e812 100644
--- a/src/modinfo.h
+++ b/src/modinfo.h
@@ -268,6 +268,13 @@ public:
virtual void setNexusDescription(const QString &description) = 0;
/**
+ * @brief sets the category id from a nexus category id. Conversion to MO id happens internally
+ * @param categoryID the nexus category id
+ * @note if a mapping is not possible, the category is set to the default value
+ */
+ virtual void addNexusCategory(int categoryID) = 0;
+
+ /**
* update the endorsement state for the mod. This only changes the
* buffered state, it does not sync with Nexus
* @param endorsed the new endorsement state
@@ -606,6 +613,13 @@ public:
virtual void setNexusDescription(const QString &description);
/**
+ * @brief sets the category id from a nexus category id. Conversion to MO id happens internally
+ * @param categoryID the nexus category id
+ * @note if a mapping is not possible, the category is set to the default value
+ */
+ virtual void addNexusCategory(int categoryID);
+
+ /**
* @brief sets the new primary category of the mod
* @param categoryID the category to set
*/
@@ -854,6 +868,7 @@ public:
virtual void setNewestVersion(const MOBase::VersionInfo&) {}
virtual void ignoreUpdate(bool) {}
virtual void setNexusDescription(const QString&) {}
+ virtual void addNexusCategory(int) {}
virtual void setIsEndorsed(bool) {}
virtual void setNeverEndorse() {}
virtual bool remove() { return false; }