From 166e5248db165086a964a9205d875cc92091c587 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Fri, 25 Feb 2011 13:07:42 +0200 Subject: [PATCH] GUI: Rename methods. We don't need the 'type' postfix. We are handling applications, not application types. --- gui/applicationlist.cpp | 22 +++++++++++----------- gui/applicationlist.h | 9 ++++----- gui/settingsdialog.cpp | 4 ++-- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/gui/applicationlist.cpp b/gui/applicationlist.cpp index a69c0c217..25edf5d99 100644 --- a/gui/applicationlist.cpp +++ b/gui/applicationlist.cpp @@ -52,14 +52,14 @@ void ApplicationList::LoadSettings(QSettings *programSettings) // use as default for gnome environments if (QFileInfo("/usr/bin/gedit").isExecutable()) { - AddApplicationType("gedit", "/usr/bin/gedit +(line) (file)"); + AddApplication("gedit", "/usr/bin/gedit +(line) (file)"); defapp = 0; break; } // use as default for kde environments if (QFileInfo("/usr/bin/kate").isExecutable()) { - AddApplicationType("kate", "/usr/bin/kate -l(line) (file)"); + AddApplication("kate", "/usr/bin/kate -l(line) (file)"); defapp = 0; break; } @@ -77,7 +77,7 @@ void ApplicationList::LoadSettings(QSettings *programSettings) { for (int i = 0; i < names.size(); i++) { - AddApplicationType(names[i], paths[i]); + AddApplication(names[i], paths[i]); } mDefaultApplicationIndex = 1; } @@ -126,9 +126,9 @@ QString ApplicationList::GetApplicationPath(const int index) const } -void ApplicationList::SetApplicationType(const int index, - const QString &name, - const QString &path) +void ApplicationList::SetApplication(const int index, + const QString &name, + const QString &path) { if (index >= 0 && index < mApplications.size()) { @@ -137,7 +137,7 @@ void ApplicationList::SetApplicationType(const int index, } } -void ApplicationList::AddApplicationType(const QString &name, const QString &path) +void ApplicationList::AddApplication(const QString &name, const QString &path) { if (name.isEmpty() || path.isEmpty()) { @@ -163,7 +163,7 @@ void ApplicationList::SetDefault(const int index) } } -void ApplicationList::Copy(ApplicationList *list) +void ApplicationList::Copy(const ApplicationList *list) { if (!list) { @@ -173,7 +173,7 @@ void ApplicationList::Copy(ApplicationList *list) Clear(); for (int i = 0; i < list->GetApplicationCount(); i++) { - AddApplicationType(list->GetApplicationName(i), list->GetApplicationPath(i)); + AddApplication(list->GetApplicationName(i), list->GetApplicationPath(i)); } mDefaultApplicationIndex = list->GetDefaultApplication(); } @@ -190,7 +190,7 @@ bool ApplicationList::FindDefaultWindowsEditor() const QString notepadppPath = appPath + "\\Notepad++\\notepad++.exe"; if (QFileInfo(notepadppPath).isExecutable()) { - AddApplicationType("Notepad++", "\"" + notepadppPath + "\" -n(line) (file)"); + AddApplication("Notepad++", "\"" + notepadppPath + "\" -n(line) (file)"); return true; } @@ -198,7 +198,7 @@ bool ApplicationList::FindDefaultWindowsEditor() const QString notepadPath = windowsPath + "\\system32\\notepad.exe"; if (QFileInfo(notepadPath).isExecutable()) { - AddApplicationType("Notepad", notepadPath + " (file)"); + AddApplication("Notepad", notepadPath + " (file)"); return true; } return false; diff --git a/gui/applicationlist.h b/gui/applicationlist.h index 280446460..9bad886a8 100644 --- a/gui/applicationlist.h +++ b/gui/applicationlist.h @@ -122,9 +122,8 @@ public: * @param name New name for the application * @param path New path for the application */ - void SetApplicationType(const int index, - const QString &name, - const QString &path); + void SetApplication(const int index, const QString &name, + const QString &path); /** * @brief Add a new application @@ -132,7 +131,7 @@ public: * @param name Name of the application * @param path Path to the application */ - void AddApplicationType(const QString &name, const QString &path); + void AddApplication(const QString &name, const QString &path); /** * @brief Remove an application from the list @@ -152,7 +151,7 @@ public: * list given as a parameter. * @param list Copying source */ - void Copy(ApplicationList *list); + void Copy(const ApplicationList *list); protected: diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index d3a42857a..467359ae0 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -202,7 +202,7 @@ void SettingsDialog::AddApplication() if (dialog.exec() == QDialog::Accepted) { - mTempApplications->AddApplicationType(dialog.GetName(), dialog.GetPath()); + mTempApplications->AddApplication(dialog.GetName(), dialog.GetPath()); mUI.mListWidget->addItem(dialog.GetName()); } } @@ -240,7 +240,7 @@ void SettingsDialog::EditApplication() if (dialog.exec() == QDialog::Accepted) { - mTempApplications->SetApplicationType(row, dialog.GetName(), dialog.GetPath()); + mTempApplications->SetApplication(row, dialog.GetName(), dialog.GetPath()); item->setText(dialog.GetName()); } }