@@ -36,10 +36,10 @@ ApplicationList::ApplicationList(QObject *parent) :
3636
3737ApplicationList::~ApplicationList ()
3838{
39- Clear ();
39+ clear ();
4040}
4141
42- bool ApplicationList::LoadSettings ()
42+ bool ApplicationList::loadSettings ()
4343{
4444 QSettings settings;
4545 QStringList names = settings.value (SETTINGS_APPLICATION_NAMES, QStringList ()).toStringList ();
@@ -64,18 +64,18 @@ bool ApplicationList::LoadSettings()
6464 app.setName (" gedit" );
6565 app.setPath (" /usr/bin/gedit" );
6666 app.setParameters (" +(line) (file)" );
67- AddApplication (app);
67+ addApplication (app);
6868 defapp = 0 ;
6969 }
70- CheckAndAddApplication (" /usr/bin/geany" ," geany" ," +(line) (file)" );
71- CheckAndAddApplication (" /usr/bin/qtcreator" ," Qt Creator" ," -client (file):(line)" );
70+ checkAndAddApplication (" /usr/bin/geany" ," geany" ," +(line) (file)" );
71+ checkAndAddApplication (" /usr/bin/qtcreator" ," Qt Creator" ," -client (file):(line)" );
7272 // use as default for kde environments
7373 if (QFileInfo (" /usr/bin/kate" ).isExecutable ()) {
7474 Application app;
7575 app.setName (" kate" );
7676 app.setPath (" /usr/bin/kate" );
7777 app.setParameters (" -l(line) (file)" );
78- AddApplication (app);
78+ addApplication (app);
7979 defapp = 0 ;
8080 }
8181#else
@@ -86,7 +86,7 @@ bool ApplicationList::LoadSettings()
8686 } else if (names.size () == paths.size ()) {
8787 for (int i = 0 ; i < names.size (); i++) {
8888 const Application app (names[i], paths[i], params[i]);
89- AddApplication (app);
89+ addApplication (app);
9090 }
9191 }
9292
@@ -100,15 +100,15 @@ bool ApplicationList::LoadSettings()
100100 return succeeded;
101101}
102102
103- void ApplicationList::SaveSettings () const
103+ void ApplicationList::saveSettings () const
104104{
105105 QSettings settings;
106106 QStringList names;
107107 QStringList paths;
108108 QStringList params;
109109
110- for (int i = 0 ; i < GetApplicationCount (); i++) {
111- const Application& app = GetApplication (i);
110+ for (int i = 0 ; i < getApplicationCount (); i++) {
111+ const Application& app = getApplication (i);
112112 names << app.getName ();
113113 paths << app.getPath ();
114114 params << app.getParameters ();
@@ -120,12 +120,12 @@ void ApplicationList::SaveSettings() const
120120 settings.setValue (SETTINGS_APPLICATION_DEFAULT, mDefaultApplicationIndex );
121121}
122122
123- int ApplicationList::GetApplicationCount () const
123+ int ApplicationList::getApplicationCount () const
124124{
125125 return mApplications .size ();
126126}
127127
128- Application& ApplicationList::GetApplication (const int index)
128+ Application& ApplicationList::getApplication (const int index)
129129{
130130 if (index >= 0 && index < mApplications .size ()) {
131131 return mApplications [index];
@@ -135,7 +135,7 @@ Application& ApplicationList::GetApplication(const int index)
135135 return dummy;
136136}
137137
138- const Application& ApplicationList::GetApplication (const int index) const
138+ const Application& ApplicationList::getApplication (const int index) const
139139{
140140 if (index >= 0 && index < mApplications .size ()) {
141141 return mApplications [index];
@@ -145,60 +145,60 @@ const Application& ApplicationList::GetApplication(const int index) const
145145 return dummy;
146146}
147147
148- void ApplicationList::AddApplication (const Application &app)
148+ void ApplicationList::addApplication (const Application &app)
149149{
150150 if (app.getName ().isEmpty () || app.getPath ().isEmpty ()) {
151151 return ;
152152 }
153153 mApplications << app;
154154}
155155
156- void ApplicationList::RemoveApplication (const int index)
156+ void ApplicationList::removeApplication (const int index)
157157{
158158 mApplications .removeAt (index);
159159}
160160
161- void ApplicationList::SetDefault (const int index)
161+ void ApplicationList::setDefault (const int index)
162162{
163163 if (index < mApplications .size () && index >= 0 ) {
164164 mDefaultApplicationIndex = index;
165165 }
166166}
167167
168- void ApplicationList::Copy (const ApplicationList *list)
168+ void ApplicationList::copy (const ApplicationList *list)
169169{
170170 if (!list) {
171171 return ;
172172 }
173173
174- Clear ();
175- for (int i = 0 ; i < list->GetApplicationCount (); i++) {
176- const Application& app = list->GetApplication (i);
177- AddApplication (app);
174+ clear ();
175+ for (int i = 0 ; i < list->getApplicationCount (); i++) {
176+ const Application& app = list->getApplication (i);
177+ addApplication (app);
178178 }
179- mDefaultApplicationIndex = list->GetDefaultApplication ();
179+ mDefaultApplicationIndex = list->getDefaultApplication ();
180180}
181181
182- void ApplicationList::Clear ()
182+ void ApplicationList::clear ()
183183{
184184 mApplications .clear ();
185185 mDefaultApplicationIndex = -1 ;
186186}
187187
188- bool ApplicationList::CheckAndAddApplication (QString appPath, QString name, QString parameters)
188+ bool ApplicationList::checkAndAddApplication (QString appPath, QString name, QString parameters)
189189{
190190 if (QFileInfo (appPath).exists () && QFileInfo (appPath).isExecutable ()) {
191191 Application app;
192192 app.setName (name);
193193 app.setPath (" \" " + appPath + " \" " );
194194 app.setParameters (parameters);
195- AddApplication (app);
195+ addApplication (app);
196196 return true ;
197197 }
198198 return false ;
199199}
200200
201- bool ApplicationList::FindDefaultWindowsEditor ()
201+ bool ApplicationList::findDefaultWindowsEditor ()
202202{
203203 bool foundOne = false ;
204204#ifdef WIN64 // As long as we do support 32-bit XP, we cannot be sure that the environment variable "ProgramFiles(x86)" exists
@@ -209,24 +209,24 @@ bool ApplicationList::FindDefaultWindowsEditor()
209209 const QString appPathx64 (getenv (" ProgramW6432" ));
210210 const QString windowsPath (getenv (" windir" ));
211211
212- if (CheckAndAddApplication (appPathx86 + " \\ Notepad++\\ notepad++.exe" , " Notepad++" , " -n(line) (file)" ))
212+ if (checkAndAddApplication (appPathx86 + " \\ Notepad++\\ notepad++.exe" , " Notepad++" , " -n(line) (file)" ))
213213 foundOne = true ;
214- else if (CheckAndAddApplication (appPathx64 + " \\ Notepad++\\ notepad++.exe" , " Notepad++" , " -n(line) (file)" ))
214+ else if (checkAndAddApplication (appPathx64 + " \\ Notepad++\\ notepad++.exe" , " Notepad++" , " -n(line) (file)" ))
215215 foundOne = true ;
216216
217- if (CheckAndAddApplication (appPathx86 + " \\ Notepad2\\ Notepad2.exe" , " Notepad2" , " /g (line) (file)" ))
217+ if (checkAndAddApplication (appPathx86 + " \\ Notepad2\\ Notepad2.exe" , " Notepad2" , " /g (line) (file)" ))
218218 foundOne = true ;
219- else if (CheckAndAddApplication (appPathx64 + " \\ Notepad2\\ Notepad2.exe" , " Notepad2" , " /g (line) (file)" ))
219+ else if (checkAndAddApplication (appPathx64 + " \\ Notepad2\\ Notepad2.exe" , " Notepad2" , " /g (line) (file)" ))
220220 foundOne = true ;
221221
222- if (CheckAndAddApplication (windowsPath + " \\ system32\\ notepad.exe" , " Notepad" , " (file)" ))
222+ if (checkAndAddApplication (windowsPath + " \\ system32\\ notepad.exe" , " Notepad" , " (file)" ))
223223 foundOne = true ;
224224
225225 QString regPath = " HKEY_CLASSES_ROOT\\ Applications\\ QtProject.QtCreator.pro\\ shell\\ Open\\ command" ;
226226 QSettings registry (regPath, QSettings::NativeFormat);
227227 QString qtCreatorRegistry = registry.value (" Default" , QString ()).toString ();
228228 QString qtCreatorPath = qtCreatorRegistry.left (qtCreatorRegistry.indexOf (" .exe" ) + 4 );
229- if (!qtCreatorRegistry.isEmpty () && CheckAndAddApplication (qtCreatorPath, " Qt Creator" , " -client (file):(line)" )) {
229+ if (!qtCreatorRegistry.isEmpty () && checkAndAddApplication (qtCreatorPath, " Qt Creator" , " -client (file):(line)" )) {
230230 foundOne = true ;
231231 }
232232 return foundOne;
0 commit comments