summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/editexecutablesdialog.cpp10
-rw-r--r--src/executableslist.h11
-rw-r--r--src/mainwindow.cpp8
-rw-r--r--src/organizercore.cpp6
4 files changed, 13 insertions, 22 deletions
diff --git a/src/editexecutablesdialog.cpp b/src/editexecutablesdialog.cpp
index 5a76195e..c4d99a39 100644
--- a/src/editexecutablesdialog.cpp
+++ b/src/editexecutablesdialog.cpp
@@ -30,8 +30,10 @@ using namespace MOBase;
using namespace MOShared;
EditExecutablesDialog::EditExecutablesDialog(const ExecutablesList &executablesList, QWidget *parent)
- : TutorableDialog("EditExecutables", parent),
- ui(new Ui::EditExecutablesDialog), m_CurrentItem(nullptr), m_ExecutablesList(executablesList)
+ : TutorableDialog("EditExecutables", parent)
+ , ui(new Ui::EditExecutablesDialog)
+ , m_CurrentItem(nullptr)
+ , m_ExecutablesList(executablesList)
{
ui->setupUi(this);
@@ -69,9 +71,9 @@ void EditExecutablesDialog::refreshExecutablesWidget()
}
-void EditExecutablesDialog::on_binaryEdit_textChanged(const QString &arg1)
+void EditExecutablesDialog::on_binaryEdit_textChanged(const QString &name)
{
- QFileInfo fileInfo(arg1);
+ QFileInfo fileInfo(name);
ui->addButton->setEnabled(fileInfo.exists() && fileInfo.isFile());
}
diff --git a/src/executableslist.h b/src/executableslist.h
index 37e903e5..b4054bcc 100644
--- a/src/executableslist.h
+++ b/src/executableslist.h
@@ -53,7 +53,7 @@ struct Executable {
bool isCustom() const { return m_Flags.testFlag(CustomExecutable); }
- bool shownOnToolbar() const { return m_Flags.testFlag(ShowInToolbar); }
+ bool isShownOnToolbar() const { return m_Flags.testFlag(ShowInToolbar); }
void showOnToolbar(bool state);
@@ -81,15 +81,6 @@ public:
void init(MOBase::IPluginGame *game);
/**
- * @brief retrieve an executable by index
- *
- * @param index index of the executable to look up
- * @return reference to the executable
- * @exception out_of_range will throw an exception if the index is invalid
- **/
- const Executable &get(int index) const { return m_Executables.at(index); }
-
- /**
* @brief find an executable by its name
*
* @param title the title of the executable to look up
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 3d6c6ef2..f265d74a 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -509,7 +509,7 @@ void MainWindow::updateToolBar()
std::vector<Executable>::iterator begin, end;
m_OrganizerCore.executablesList()->getExecutables(begin, end);
for (auto iter = begin; iter != end; ++iter) {
- if (iter->shownOnToolbar()) {
+ if (iter->isShownOnToolbar()) {
QAction *exeAction = new QAction(iconForExecutable(iter->m_BinaryInfo.filePath()),
iter->m_Title,
ui->toolBar);
@@ -3290,8 +3290,8 @@ void MainWindow::on_savegameList_customContextMenuRequested(const QPoint &pos)
void MainWindow::linkToolbar()
{
Executable &exe(getSelectedExecutable());
- exe.showOnToolbar(!exe.shownOnToolbar());
- ui->linkButton->menu()->actions().at(static_cast<int>(ShortcutType::Toolbar))->setIcon(exe.shownOnToolbar() ? QIcon(":/MO/gui/remove") : QIcon(":/MO/gui/link"));
+ exe.showOnToolbar(!exe.isShownOnToolbar());
+ ui->linkButton->menu()->actions().at(static_cast<int>(ShortcutType::Toolbar))->setIcon(exe.isShownOnToolbar() ? QIcon(":/MO/gui/remove") : QIcon(":/MO/gui/link"));
updateToolBar();
}
@@ -4267,7 +4267,7 @@ void MainWindow::on_linkButton_pressed()
const QFileInfo linkDesktopFile(getDesktopLinkfile(selectedExecutable));
const QFileInfo linkMenuFile(getStartMenuLinkfile(selectedExecutable));
- ui->linkButton->menu()->actions().at(static_cast<int>(ShortcutType::Toolbar))->setIcon(selectedExecutable.shownOnToolbar() ? removeIcon : addIcon);
+ ui->linkButton->menu()->actions().at(static_cast<int>(ShortcutType::Toolbar))->setIcon(selectedExecutable.isShownOnToolbar() ? removeIcon : addIcon);
ui->linkButton->menu()->actions().at(static_cast<int>(ShortcutType::Desktop))->setIcon(linkDesktopFile.exists() ? removeIcon : addIcon);
ui->linkButton->menu()->actions().at(static_cast<int>(ShortcutType::StartMenu))->setIcon(linkMenuFile.exists() ? removeIcon : addIcon);
}
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index fe19bb90..a9284e97 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -223,7 +223,7 @@ QSettings::Status OrganizerCore::storeSettings(const QString &fileName)
settings.setArrayIndex(count++);
settings.setValue("title", item.m_Title);
settings.setValue("custom", item.isCustom());
- settings.setValue("toolbar", item.shownOnToolbar());
+ settings.setValue("toolbar", item.isShownOnToolbar());
settings.setValue("ownicon", item.usesOwnIcon());
if (item.isCustom()) {
settings.setValue("binary", item.m_BinaryInfo.absoluteFilePath());
@@ -338,7 +338,6 @@ void OrganizerCore::updateExecutablesList(QSettings &settings)
if (settings.value("toolbar", false).toBool()) flags |= Executable::ShowInToolbar;
if (settings.value("ownicon", false).toBool()) flags |= Executable::UseApplicationIcon;
-
m_ExecutablesList.addExecutable(settings.value("title").toString(),
settings.value("binary").toString(),
settings.value("arguments").toString(),
@@ -350,7 +349,6 @@ void OrganizerCore::updateExecutablesList(QSettings &settings)
settings.endArray();
-
// TODO this has nothing to do with executables list move to an appropriate function!
ModInfo::updateFromDisc(m_Settings.getModDirectory(), &m_DirectoryStructure, m_Settings.displayForeign());
}
@@ -1027,7 +1025,7 @@ HANDLE OrganizerCore::startApplication(const QString &executable, const QStringL
try {
const Executable &exe = m_ExecutablesList.findByBinary(binary);
steamAppID = exe.m_SteamAppID;
- } catch (const std::runtime_error&) {
+ } catch (const std::runtime_error&) {
// nop
}
} else {