Skip to content

Commit 166e524

Browse files
committed
GUI: Rename methods.
We don't need the 'type' postfix. We are handling applications, not application types.
1 parent e6e616e commit 166e524

3 files changed

Lines changed: 17 additions & 18 deletions

File tree

gui/applicationlist.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ void ApplicationList::LoadSettings(QSettings *programSettings)
5252
// use as default for gnome environments
5353
if (QFileInfo("/usr/bin/gedit").isExecutable())
5454
{
55-
AddApplicationType("gedit", "/usr/bin/gedit +(line) (file)");
55+
AddApplication("gedit", "/usr/bin/gedit +(line) (file)");
5656
defapp = 0;
5757
break;
5858
}
5959
// use as default for kde environments
6060
if (QFileInfo("/usr/bin/kate").isExecutable())
6161
{
62-
AddApplicationType("kate", "/usr/bin/kate -l(line) (file)");
62+
AddApplication("kate", "/usr/bin/kate -l(line) (file)");
6363
defapp = 0;
6464
break;
6565
}
@@ -77,7 +77,7 @@ void ApplicationList::LoadSettings(QSettings *programSettings)
7777
{
7878
for (int i = 0; i < names.size(); i++)
7979
{
80-
AddApplicationType(names[i], paths[i]);
80+
AddApplication(names[i], paths[i]);
8181
}
8282
mDefaultApplicationIndex = 1;
8383
}
@@ -126,9 +126,9 @@ QString ApplicationList::GetApplicationPath(const int index) const
126126

127127
}
128128

129-
void ApplicationList::SetApplicationType(const int index,
130-
const QString &name,
131-
const QString &path)
129+
void ApplicationList::SetApplication(const int index,
130+
const QString &name,
131+
const QString &path)
132132
{
133133
if (index >= 0 && index < mApplications.size())
134134
{
@@ -137,7 +137,7 @@ void ApplicationList::SetApplicationType(const int index,
137137
}
138138
}
139139

140-
void ApplicationList::AddApplicationType(const QString &name, const QString &path)
140+
void ApplicationList::AddApplication(const QString &name, const QString &path)
141141
{
142142
if (name.isEmpty() || path.isEmpty())
143143
{
@@ -163,7 +163,7 @@ void ApplicationList::SetDefault(const int index)
163163
}
164164
}
165165

166-
void ApplicationList::Copy(ApplicationList *list)
166+
void ApplicationList::Copy(const ApplicationList *list)
167167
{
168168
if (!list)
169169
{
@@ -173,7 +173,7 @@ void ApplicationList::Copy(ApplicationList *list)
173173
Clear();
174174
for (int i = 0; i < list->GetApplicationCount(); i++)
175175
{
176-
AddApplicationType(list->GetApplicationName(i), list->GetApplicationPath(i));
176+
AddApplication(list->GetApplicationName(i), list->GetApplicationPath(i));
177177
}
178178
mDefaultApplicationIndex = list->GetDefaultApplication();
179179
}
@@ -190,15 +190,15 @@ bool ApplicationList::FindDefaultWindowsEditor()
190190
const QString notepadppPath = appPath + "\\Notepad++\\notepad++.exe";
191191
if (QFileInfo(notepadppPath).isExecutable())
192192
{
193-
AddApplicationType("Notepad++", "\"" + notepadppPath + "\" -n(line) (file)");
193+
AddApplication("Notepad++", "\"" + notepadppPath + "\" -n(line) (file)");
194194
return true;
195195
}
196196

197197
const QString windowsPath(getenv("windir"));
198198
const QString notepadPath = windowsPath + "\\system32\\notepad.exe";
199199
if (QFileInfo(notepadPath).isExecutable())
200200
{
201-
AddApplicationType("Notepad", notepadPath + " (file)");
201+
AddApplication("Notepad", notepadPath + " (file)");
202202
return true;
203203
}
204204
return false;

gui/applicationlist.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,16 @@ class ApplicationList : public QObject
122122
* @param name New name for the application
123123
* @param path New path for the application
124124
*/
125-
void SetApplicationType(const int index,
126-
const QString &name,
127-
const QString &path);
125+
void SetApplication(const int index, const QString &name,
126+
const QString &path);
128127

129128
/**
130129
* @brief Add a new application
131130
*
132131
* @param name Name of the application
133132
* @param path Path to the application
134133
*/
135-
void AddApplicationType(const QString &name, const QString &path);
134+
void AddApplication(const QString &name, const QString &path);
136135

137136
/**
138137
* @brief Remove an application from the list
@@ -152,7 +151,7 @@ class ApplicationList : public QObject
152151
* list given as a parameter.
153152
* @param list Copying source
154153
*/
155-
void Copy(ApplicationList *list);
154+
void Copy(const ApplicationList *list);
156155

157156
protected:
158157

gui/settingsdialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void SettingsDialog::AddApplication()
202202

203203
if (dialog.exec() == QDialog::Accepted)
204204
{
205-
mTempApplications->AddApplicationType(dialog.GetName(), dialog.GetPath());
205+
mTempApplications->AddApplication(dialog.GetName(), dialog.GetPath());
206206
mUI.mListWidget->addItem(dialog.GetName());
207207
}
208208
}
@@ -240,7 +240,7 @@ void SettingsDialog::EditApplication()
240240

241241
if (dialog.exec() == QDialog::Accepted)
242242
{
243-
mTempApplications->SetApplicationType(row, dialog.GetName(), dialog.GetPath());
243+
mTempApplications->SetApplication(row, dialog.GetName(), dialog.GetPath());
244244
item->setText(dialog.GetName());
245245
}
246246
}

0 commit comments

Comments
 (0)