File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -418,17 +418,17 @@ QString DesktopEntryManager::extractIdFromPath(const QString& path) {
418
418
// e.g., /usr/share/applications/firefox.desktop -> firefox
419
419
// e.g., /usr/share/applications/kde4/kate.desktop -> kde4-kate
420
420
421
- QFileInfo info (path);
422
- QString id = info.completeBaseName ();
421
+ auto info = QFileInfo (path);
422
+ auto id = info.completeBaseName ();
423
423
424
424
// Find the applications directory in the path
425
- int appIdx = path.lastIndexOf (" /applications/" );
425
+ auto appIdx = path.lastIndexOf (" /applications/" );
426
426
if (appIdx != -1 ) {
427
- QString relativePath = path.mid (appIdx + 14 ); // Skip "/applications/"
428
- QFileInfo relInfo (relativePath);
427
+ auto relativePath = path.mid (appIdx + 14 ); // Skip "/applications/"
428
+ auto relInfo = QFileInfo (relativePath);
429
429
430
430
// Replace directory separators with dashes
431
- QString dirPath = relInfo.path ();
431
+ auto dirPath = relInfo.path ();
432
432
if (dirPath != " ." ) {
433
433
id = dirPath.replace (' /' , ' -' ) + ' -' + relInfo.completeBaseName ();
434
434
}
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ void DesktopEntryMonitor::onDirectoryChanged(const QString& path) {
85
85
// Check for new subdirectories
86
86
auto subdirs = dir.entryList (QDir::Dirs | QDir::NoDotAndDotDot);
87
87
for (const QString& subdir: subdirs) {
88
- QString subdirPath = dir.absoluteFilePath (subdir);
88
+ auto subdirPath = dir.absoluteFilePath (subdir);
89
89
if (!this ->watcher ->directories ().contains (subdirPath)) {
90
90
this ->scanAndWatch (subdirPath);
91
91
}
@@ -109,6 +109,6 @@ void DesktopEntryMonitor::processChanges() {
109
109
this ->pendingChanges .clear ();
110
110
111
111
// Emit with empty hash to signal full rescan needed
112
- QHash<QString, ChangeEvent> emptyChanges ;
112
+ auto emptyChanges = QHash<QString, ChangeEvent> {} ;
113
113
emit desktopEntriesChanged (emptyChanges);
114
114
}
Original file line number Diff line number Diff line change 4
4
#include < qtenvironmentvariables.h>
5
5
6
6
QList<QString> DesktopUtils::getDesktopDirectories () {
7
- QList<QString> dataPaths ;
7
+ auto dataPaths = QList<QString> {} ;
8
8
9
9
// XDG_DATA_HOME
10
- QString dataHome = qEnvironmentVariable (" XDG_DATA_HOME" );
10
+ auto dataHome = qEnvironmentVariable (" XDG_DATA_HOME" );
11
11
if (dataHome.isEmpty ()) {
12
12
if (qEnvironmentVariableIsSet (" HOME" )) {
13
13
dataHome = qEnvironmentVariable (" HOME" ) + " /.local/share" ;
@@ -18,7 +18,7 @@ QList<QString> DesktopUtils::getDesktopDirectories() {
18
18
}
19
19
20
20
// XDG_DATA_DIRS
21
- QString dataDirs = qEnvironmentVariable (" XDG_DATA_DIRS" );
21
+ auto dataDirs = qEnvironmentVariable (" XDG_DATA_DIRS" );
22
22
if (dataDirs.isEmpty ()) {
23
23
dataDirs = " /usr/local/share:/usr/share" ;
24
24
}
You can’t perform that action at this time.
0 commit comments