diff options
author | Petr Mrázek <peterix@gmail.com> | 2019-08-03 05:30:46 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2019-08-03 05:30:46 +0200 |
commit | 7d13e3119801862b9fdf64b11a45c41a64b4fc46 (patch) | |
tree | bf57acec88e4c4f09605603291d5483da2a13ab6 /application | |
parent | 40c9af1a8b2f42f4c90c8d358eac43370c04a227 (diff) | |
download | MultiMC-7d13e3119801862b9fdf64b11a45c41a64b4fc46.tar MultiMC-7d13e3119801862b9fdf64b11a45c41a64b4fc46.tar.gz MultiMC-7d13e3119801862b9fdf64b11a45c41a64b4fc46.tar.lz MultiMC-7d13e3119801862b9fdf64b11a45c41a64b4fc46.tar.xz MultiMC-7d13e3119801862b9fdf64b11a45c41a64b4fc46.zip |
NOISSUE refactor Mod a bunch, get rid of dead code
Diffstat (limited to 'application')
-rw-r--r-- | application/CMakeLists.txt | 2 | ||||
-rw-r--r-- | application/dialogs/ModEditDialogCommon.cpp | 40 | ||||
-rw-r--r-- | application/dialogs/ModEditDialogCommon.h | 9 | ||||
-rw-r--r-- | application/pages/instance/ModFolderPage.cpp | 1 | ||||
-rw-r--r-- | application/pages/instance/VersionPage.cpp | 1 | ||||
-rw-r--r-- | application/pages/instance/WorldListPage.cpp | 1 | ||||
-rw-r--r-- | application/widgets/MCModInfoFrame.cpp | 2 | ||||
-rw-r--r-- | application/widgets/ModListView.h | 2 | ||||
-rw-r--r-- | application/widgets/VersionListView.h | 2 |
9 files changed, 1 insertions, 59 deletions
diff --git a/application/CMakeLists.txt b/application/CMakeLists.txt index 73fe261a..ce204ae5 100644 --- a/application/CMakeLists.txt +++ b/application/CMakeLists.txt @@ -159,8 +159,6 @@ SET(MULTIMC_SOURCES dialogs/IconPickerDialog.h dialogs/LoginDialog.cpp dialogs/LoginDialog.h - dialogs/ModEditDialogCommon.cpp - dialogs/ModEditDialogCommon.h dialogs/NewComponentDialog.cpp dialogs/NewComponentDialog.h dialogs/NewInstanceDialog.cpp diff --git a/application/dialogs/ModEditDialogCommon.cpp b/application/dialogs/ModEditDialogCommon.cpp deleted file mode 100644 index e92c5c4d..00000000 --- a/application/dialogs/ModEditDialogCommon.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "ModEditDialogCommon.h" -#include "CustomMessageBox.h" -#include <QUrl> - -bool lastfirst(QModelIndexList &list, int &first, int &last) -{ - if (list.isEmpty()) - return false; - first = last = list[0].row(); - for (auto item : list) - { - int row = item.row(); - if (row < first) - first = row; - if (row > last) - last = row; - } - return true; -} - -void showWebsiteForMod(QWidget *parentDlg, Mod &m) -{ - QString url = m.homeurl(); - if (url.size()) - { - // catch the cases where the protocol is missing - if (!url.startsWith("http")) - { - url = "http://" + url; - } - DesktopServices::openUrl(url); - } - else - { - CustomMessageBox::selectable( - parentDlg, QObject::tr("How sad!"), - QObject::tr("The mod author didn't provide a website link for this mod."), - QMessageBox::Warning); - } -} diff --git a/application/dialogs/ModEditDialogCommon.h b/application/dialogs/ModEditDialogCommon.h deleted file mode 100644 index fc5e3c2b..00000000 --- a/application/dialogs/ModEditDialogCommon.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once -#include <QModelIndex> -#include <DesktopServices.h> -#include <QWidget> -#include <minecraft/Mod.h> - -bool lastfirst(QModelIndexList &list, int &first, int &last); - -void showWebsiteForMod(QWidget *parentDlg, Mod &m); diff --git a/application/pages/instance/ModFolderPage.cpp b/application/pages/instance/ModFolderPage.cpp index e923c4f4..03bcaa48 100644 --- a/application/pages/instance/ModFolderPage.cpp +++ b/application/pages/instance/ModFolderPage.cpp @@ -24,7 +24,6 @@ #include "MultiMC.h" #include "dialogs/CustomMessageBox.h" -#include "dialogs/ModEditDialogCommon.h" #include <GuiUtil.h> #include "minecraft/SimpleModList.h" #include "minecraft/Mod.h" diff --git a/application/pages/instance/VersionPage.cpp b/application/pages/instance/VersionPage.cpp index eb918626..e129d03d 100644 --- a/application/pages/instance/VersionPage.cpp +++ b/application/pages/instance/VersionPage.cpp @@ -27,7 +27,6 @@ #include "dialogs/CustomMessageBox.h" #include "dialogs/VersionSelectDialog.h" #include "dialogs/NewComponentDialog.h" -#include "dialogs/ModEditDialogCommon.h" #include "dialogs/ProgressDialog.h" #include <GuiUtil.h> diff --git a/application/pages/instance/WorldListPage.cpp b/application/pages/instance/WorldListPage.cpp index ca419fc5..8358a0f1 100644 --- a/application/pages/instance/WorldListPage.cpp +++ b/application/pages/instance/WorldListPage.cpp @@ -17,7 +17,6 @@ #include "ui_WorldListPage.h" #include "minecraft/WorldList.h" #include <DesktopServices.h> -#include "dialogs/ModEditDialogCommon.h" #include <QEvent> #include <QMenu> #include <QKeyEvent> diff --git a/application/widgets/MCModInfoFrame.cpp b/application/widgets/MCModInfoFrame.cpp index d28e2d40..577b32a7 100644 --- a/application/widgets/MCModInfoFrame.cpp +++ b/application/widgets/MCModInfoFrame.cpp @@ -40,7 +40,7 @@ void MCModInfoFrame::updateWithMod(Mod &m) else text = "<a href=\"" + m.homeurl() + "\">" + name + "</a>"; if (!m.authors().isEmpty()) - text += " by " + m.authors(); + text += " by " + m.authors().join(", "); setModText(text); diff --git a/application/widgets/ModListView.h b/application/widgets/ModListView.h index 189131c5..5a07e868 100644 --- a/application/widgets/ModListView.h +++ b/application/widgets/ModListView.h @@ -16,8 +16,6 @@ #pragma once #include <QTreeView> -class Mod; - class ModListView: public QTreeView { Q_OBJECT diff --git a/application/widgets/VersionListView.h b/application/widgets/VersionListView.h index 233479bb..37f7b27e 100644 --- a/application/widgets/VersionListView.h +++ b/application/widgets/VersionListView.h @@ -16,8 +16,6 @@ #pragma once #include <QTreeView> -class Mod; - class VersionListView : public QTreeView { Q_OBJECT |