Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Matthieu Gallien
Elisa
Commits
5e0c7685
Commit
5e0c7685
authored
Sep 19, 2019
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor qstring optimization
parent
b233b24b
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
98 additions
and
98 deletions
+98
-98
src/abstractfile/abstractfilelisting.cpp
src/abstractfile/abstractfilelisting.cpp
+1
-1
src/android/androidmusiclistener.cpp
src/android/androidmusiclistener.cpp
+4
-4
src/baloo/localbaloofilelisting.cpp
src/baloo/localbaloofilelisting.cpp
+4
-4
src/databaseinterface.cpp
src/databaseinterface.cpp
+18
-18
src/elisaapplication.cpp
src/elisaapplication.cpp
+13
-13
src/filescanner.cpp
src/filescanner.cpp
+2
-2
src/localFileConfiguration/localfileconfiguration.cpp
src/localFileConfiguration/localfileconfiguration.cpp
+2
-2
src/mpris2/mediaplayer2player.cpp
src/mpris2/mediaplayer2player.cpp
+1
-1
src/mpris2/mpris2.cpp
src/mpris2/mpris2.cpp
+2
-2
src/upnp/didlparser.cpp
src/upnp/didlparser.cpp
+8
-8
src/upnp/upnpcontentdirectorymodel.cpp
src/upnp/upnpcontentdirectorymodel.cpp
+13
-13
src/upnp/upnpcontrolconnectionmanager.cpp
src/upnp/upnpcontrolconnectionmanager.cpp
+14
-14
src/upnp/upnpcontrolcontentdirectory.cpp
src/upnp/upnpcontrolcontentdirectory.cpp
+14
-14
src/upnp/upnpcontrolmediaserver.cpp
src/upnp/upnpcontrolmediaserver.cpp
+1
-1
src/upnp/upnpdiscoverallmusic.cpp
src/upnp/upnpdiscoverallmusic.cpp
+1
-1
No files found.
src/abstractfile/abstractfilelisting.cpp
View file @
5e0c7685
...
...
@@ -299,7 +299,7 @@ MusicAudioTrack AbstractFileListing::scanOneFile(const QUrl &scanFile, const QFi
auto
localFileName
=
scanFile
.
toLocalFile
();
const
auto
&
fileMimeType
=
d
->
mMimeDb
.
mimeTypeForFile
(
localFileName
);
if
(
!
fileMimeType
.
name
().
startsWith
(
QString
Literal
(
"audio/"
)))
{
if
(
!
fileMimeType
.
name
().
startsWith
(
Q
Latin1
String
(
"audio/"
)))
{
return
newTrack
;
}
...
...
src/android/androidmusiclistener.cpp
View file @
5e0c7685
...
...
@@ -127,19 +127,19 @@ void AndroidMusicListener::newMusicTrack(const QString &trackDescription)
auto
newTrack
=
MusicAudioTrack
{};
newTrack
.
setTitle
(
trackData
[
1
]);
bool
conversionOK
=
false
;
if
(
trackData
[
2
]
!=
QString
Literal
(
"null"
))
{
if
(
trackData
[
2
]
!=
Q
Latin1
String
(
"null"
))
{
newTrack
.
setTrackNumber
(
trackData
[
2
].
toInt
(
&
conversionOK
));
if
(
!
conversionOK
)
{
qInfo
()
<<
"newMusicTrack"
<<
trackData
[
1
]
<<
trackData
[
2
];
}
}
if
(
trackData
[
3
]
!=
QString
Literal
(
"null"
))
{
if
(
trackData
[
3
]
!=
Q
Latin1
String
(
"null"
))
{
newTrack
.
setYear
(
trackData
[
3
].
toInt
(
&
conversionOK
));
if
(
!
conversionOK
)
{
qInfo
()
<<
"newMusicTrack"
<<
trackData
[
1
]
<<
trackData
[
3
];
}
}
if
(
trackData
[
4
]
!=
QString
Literal
(
"null"
))
{
if
(
trackData
[
4
]
!=
Q
Latin1
String
(
"null"
))
{
newTrack
.
setDuration
(
QTime
::
fromMSecsSinceStartOfDay
(
trackData
[
4
].
toInt
()));
}
newTrack
.
setResourceURI
(
QUrl
::
fromLocalFile
(
trackData
[
5
]));
...
...
@@ -162,7 +162,7 @@ void AndroidMusicListener::newMusicAlbum(const QString &albumDescription)
{
auto
albumData
=
albumDescription
.
split
(
QStringLiteral
(
"||"
));
if
(
albumData
[
2
]
!=
QString
Literal
(
"null)"
))
{
if
(
albumData
[
2
]
!=
Q
Latin1
String
(
"null)"
))
{
d
->
mCovers
[
albumData
[
1
]]
=
QUrl
::
fromLocalFile
(
albumData
[
2
]);
}
}
...
...
src/baloo/localbaloofilelisting.cpp
View file @
5e0c7685
...
...
@@ -135,7 +135,7 @@ void LocalBalooFileListing::newBalooFile(const QString &fileName)
}
const
auto
&
fileMimeType
=
mimeDatabase
().
mimeTypeForFile
(
fileName
);
if
(
!
fileMimeType
.
name
().
startsWith
(
QString
Literal
(
"audio/"
)))
{
if
(
!
fileMimeType
.
name
().
startsWith
(
Q
Latin1
String
(
"audio/"
)))
{
return
;
}
...
...
@@ -275,7 +275,7 @@ void LocalBalooFileListing::serviceOwnerChanged(const QString &serviceName, cons
qCDebug
(
orgKdeElisaBaloo
)
<<
"LocalBalooFileListing::serviceOwnerChanged"
<<
serviceName
<<
oldOwner
<<
newOwner
;
if
(
serviceName
==
QString
Literal
(
"org.kde.baloo"
)
&&
!
newOwner
.
isEmpty
())
{
if
(
serviceName
==
Q
Latin1
String
(
"org.kde.baloo"
)
&&
!
newOwner
.
isEmpty
())
{
d
->
mIsRegisteredToBaloo
=
false
;
d
->
mIsRegisteredToBalooWatcher
=
false
;
registerToBaloo
();
...
...
@@ -286,7 +286,7 @@ void LocalBalooFileListing::serviceRegistered(const QString &serviceName)
{
qCDebug
(
orgKdeElisaBaloo
)
<<
"LocalBalooFileListing::serviceRegistered"
<<
serviceName
;
if
(
serviceName
==
QString
Literal
(
"org.kde.baloo"
))
{
if
(
serviceName
==
Q
Latin1
String
(
"org.kde.baloo"
))
{
registerToBaloo
();
}
}
...
...
@@ -295,7 +295,7 @@ void LocalBalooFileListing::serviceUnregistered(const QString &serviceName)
{
qCDebug
(
orgKdeElisaBaloo
)
<<
"LocalBalooFileListing::serviceUnregistered"
<<
serviceName
;
if
(
serviceName
==
QString
Literal
(
"org.kde.baloo"
))
{
if
(
serviceName
==
Q
Latin1
String
(
"org.kde.baloo"
))
{
d
->
mIsRegisteredToBaloo
=
false
;
d
->
mIsRegisteredToBalooWatcher
=
false
;
}
...
...
src/databaseinterface.cpp
View file @
5e0c7685
...
...
@@ -1158,13 +1158,13 @@ void DatabaseInterface::initDatabase()
{
auto
listTables
=
d
->
mTracksDatabase
.
tables
();
if
(
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV2"
))
||
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV3"
))
||
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV4"
))
||
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV6"
))
||
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV7"
))
||
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV8"
))
||
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV10"
)))
{
if
(
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV2"
))
||
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV3"
))
||
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV4"
))
||
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV6"
))
||
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV7"
))
||
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV8"
))
||
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV10"
)))
{
qCDebug
(
orgKdeElisaDatabase
())
<<
"Old database schema unsupported: delete and start from scratch"
;
qCDebug
(
orgKdeElisaDatabase
())
<<
"list of old tables"
<<
d
->
mTracksDatabase
.
tables
();
...
...
@@ -1195,7 +1195,7 @@ void DatabaseInterface::initDatabase()
QSqlQuery
createSchemaQuery
(
d
->
mTracksDatabase
);
auto
result
=
createSchemaQuery
.
exec
(
QString
Literal
(
"DROP TABLE "
)
+
oneTable
);
auto
result
=
createSchemaQuery
.
exec
(
Q
Latin1
String
(
"DROP TABLE "
)
+
oneTable
);
if
(
!
result
)
{
qCDebug
(
orgKdeElisaDatabase
)
<<
"DatabaseInterface::initDatabase"
<<
createSchemaQuery
.
lastQuery
();
...
...
@@ -1210,8 +1210,8 @@ void DatabaseInterface::initDatabase()
listTables
=
d
->
mTracksDatabase
.
tables
();
if
(
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV5"
))
&&
!
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV9"
)))
{
if
(
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV5"
))
&&
!
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV9"
)))
{
upgradeDatabaseV9
();
upgradeDatabaseV11
();
upgradeDatabaseV12
();
...
...
@@ -1219,17 +1219,17 @@ void DatabaseInterface::initDatabase()
upgradeDatabaseV14
();
checkDatabaseSchema
();
}
else
if
(
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV9"
)))
{
if
(
!
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV11"
)))
{
}
else
if
(
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV9"
)))
{
if
(
!
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV11"
)))
{
upgradeDatabaseV11
();
}
if
(
!
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV12"
)))
{
if
(
!
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV12"
)))
{
upgradeDatabaseV12
();
}
if
(
!
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV13"
)))
{
if
(
!
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV13"
)))
{
upgradeDatabaseV13
();
}
if
(
!
listTables
.
contains
(
QString
Literal
(
"DatabaseVersionV14"
)))
{
if
(
!
listTables
.
contains
(
Q
Latin1
String
(
"DatabaseVersionV14"
)))
{
upgradeDatabaseV14
();
}
...
...
@@ -6363,7 +6363,7 @@ DatabaseInterface::TrackDataType DatabaseInterface::buildTrackDataFromDatabaseRe
if
(
!
trackRecord
.
value
(
14
).
toString
().
isEmpty
())
{
result
[
TrackDataType
::
key_type
::
ImageUrlRole
]
=
QUrl
(
trackRecord
.
value
(
14
).
toString
());
}
else
if
(
!
trackRecord
.
value
(
30
).
toString
().
isEmpty
())
{
result
[
TrackDataType
::
key_type
::
ImageUrlRole
]
=
QVariant
{
QString
Literal
(
"image://cover/"
)
+
trackRecord
.
value
(
30
).
toUrl
().
toLocalFile
()};
result
[
TrackDataType
::
key_type
::
ImageUrlRole
]
=
QVariant
{
Q
Latin1
String
(
"image://cover/"
)
+
trackRecord
.
value
(
30
).
toUrl
().
toLocalFile
()};
}
result
[
TrackDataType
::
key_type
::
IsSingleDiscAlbumRole
]
=
trackRecord
.
value
(
15
);
if
(
!
trackRecord
.
value
(
16
).
isNull
())
{
...
...
@@ -7351,7 +7351,7 @@ DatabaseInterface::ListAlbumDataType DatabaseInterface::internalAllAlbumsPartial
if
(
!
currentRecord
.
value
(
3
).
toString
().
isEmpty
())
{
newData
[
DataType
::
key_type
::
ImageUrlRole
]
=
currentRecord
.
value
(
3
);
}
else
if
(
!
currentRecord
.
value
(
10
).
toString
().
isEmpty
())
{
newData
[
DataType
::
key_type
::
ImageUrlRole
]
=
QVariant
{
QString
Literal
(
"image://cover/"
)
+
currentRecord
.
value
(
10
).
toUrl
().
toLocalFile
()};
newData
[
DataType
::
key_type
::
ImageUrlRole
]
=
QVariant
{
Q
Latin1
String
(
"image://cover/"
)
+
currentRecord
.
value
(
10
).
toUrl
().
toLocalFile
()};
}
auto
allArtists
=
currentRecord
.
value
(
6
).
toString
().
split
(
QStringLiteral
(
", "
));
allArtists
.
removeDuplicates
();
...
...
@@ -7399,7 +7399,7 @@ DatabaseInterface::AlbumDataType DatabaseInterface::internalOneAlbumPartialData(
if
(
!
currentRecord
.
value
(
4
).
toString
().
isEmpty
())
{
result
[
DataType
::
key_type
::
ImageUrlRole
]
=
currentRecord
.
value
(
4
);
}
else
if
(
!
currentRecord
.
value
(
11
).
toString
().
isEmpty
())
{
result
[
DataType
::
key_type
::
ImageUrlRole
]
=
QVariant
{
QString
Literal
(
"image://cover/"
)
+
currentRecord
.
value
(
11
).
toUrl
().
toLocalFile
()};
result
[
DataType
::
key_type
::
ImageUrlRole
]
=
QVariant
{
Q
Latin1
String
(
"image://cover/"
)
+
currentRecord
.
value
(
11
).
toUrl
().
toLocalFile
()};
}
auto
allArtists
=
currentRecord
.
value
(
8
).
toString
().
split
(
QStringLiteral
(
", "
));
...
...
src/elisaapplication.cpp
View file @
5e0c7685
...
...
@@ -109,63 +109,63 @@ ElisaApplication::~ElisaApplication()
void
ElisaApplication
::
setupActions
(
const
QString
&
actionName
)
{
#if defined KF5XmlGui_FOUND && KF5XmlGui_FOUND
if
(
actionName
==
QString
Literal
(
"file_quit"
))
{
if
(
actionName
==
Q
Latin1
String
(
"file_quit"
))
{
auto
quitAction
=
KStandardAction
::
quit
(
QCoreApplication
::
instance
(),
&
QCoreApplication
::
quit
,
&
d
->
mCollection
);
d
->
mCollection
.
addAction
(
actionName
,
quitAction
);
}
if
(
actionName
==
QString
Literal
(
"help_contents"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
if
(
actionName
==
Q
Latin1
String
(
"help_contents"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
auto
handBookAction
=
KStandardAction
::
helpContents
(
this
,
&
ElisaApplication
::
appHelpActivated
,
&
d
->
mCollection
);
d
->
mCollection
.
addAction
(
handBookAction
->
objectName
(),
handBookAction
);
}
if
(
actionName
==
QString
Literal
(
"help_report_bug"
)
&&
KAuthorized
::
authorizeAction
(
actionName
)
&&
!
KAboutData
::
applicationData
().
bugAddress
().
isEmpty
())
{
if
(
actionName
==
Q
Latin1
String
(
"help_report_bug"
)
&&
KAuthorized
::
authorizeAction
(
actionName
)
&&
!
KAboutData
::
applicationData
().
bugAddress
().
isEmpty
())
{
auto
reportBugAction
=
KStandardAction
::
reportBug
(
this
,
&
ElisaApplication
::
reportBug
,
&
d
->
mCollection
);
d
->
mCollection
.
addAction
(
reportBugAction
->
objectName
(),
reportBugAction
);
}
if
(
actionName
==
QString
Literal
(
"help_about_app"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
if
(
actionName
==
Q
Latin1
String
(
"help_about_app"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
auto
aboutAppAction
=
KStandardAction
::
aboutApp
(
this
,
&
ElisaApplication
::
aboutApplication
,
this
);
d
->
mCollection
.
addAction
(
aboutAppAction
->
objectName
(),
aboutAppAction
);
}
if
(
actionName
==
QString
Literal
(
"options_configure"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
if
(
actionName
==
Q
Latin1
String
(
"options_configure"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
auto
preferencesAction
=
KStandardAction
::
preferences
(
this
,
&
ElisaApplication
::
configureElisa
,
this
);
d
->
mCollection
.
addAction
(
preferencesAction
->
objectName
(),
preferencesAction
);
}
if
(
actionName
==
QString
Literal
(
"options_configure_keybinding"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
if
(
actionName
==
Q
Latin1
String
(
"options_configure_keybinding"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
auto
keyBindingsAction
=
KStandardAction
::
keyBindings
(
this
,
&
ElisaApplication
::
configureShortcuts
,
this
);
d
->
mCollection
.
addAction
(
keyBindingsAction
->
objectName
(),
keyBindingsAction
);
}
if
(
actionName
==
QString
Literal
(
"go_back"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
if
(
actionName
==
Q
Latin1
String
(
"go_back"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
auto
goBackAction
=
KStandardAction
::
back
(
this
,
&
ElisaApplication
::
goBack
,
this
);
d
->
mCollection
.
addAction
(
goBackAction
->
objectName
(),
goBackAction
);
}
if
(
actionName
==
QString
Literal
(
"toggle_playlist"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
if
(
actionName
==
Q
Latin1
String
(
"toggle_playlist"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
auto
togglePlaylistAction
=
d
->
mCollection
.
addAction
(
actionName
,
this
,
&
ElisaApplication
::
togglePlaylist
);
togglePlaylistAction
->
setShortcut
(
QKeySequence
(
Qt
::
Key_F9
));
togglePlaylistAction
->
setText
(
QStringLiteral
(
"Toggle Playlist"
));
}
if
(
actionName
==
QString
Literal
(
"Seek"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
if
(
actionName
==
Q
Latin1
String
(
"Seek"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
auto
seekAction
=
d
->
mCollection
.
addAction
(
actionName
,
this
,
&
ElisaApplication
::
seek
);
d
->
mCollection
.
setDefaultShortcut
(
seekAction
,
QKeySequence
(
Qt
::
SHIFT
+
Qt
::
Key_Right
));
}
if
(
actionName
==
QString
Literal
(
"Scrub"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
if
(
actionName
==
Q
Latin1
String
(
"Scrub"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
auto
scrubAction
=
d
->
mCollection
.
addAction
(
actionName
,
this
,
&
ElisaApplication
::
scrub
);
d
->
mCollection
.
setDefaultShortcut
(
scrubAction
,
QKeySequence
(
Qt
::
SHIFT
+
Qt
::
Key_Left
));
}
if
(
actionName
==
QString
Literal
(
"Play-Pause"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
if
(
actionName
==
Q
Latin1
String
(
"Play-Pause"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
auto
playPauseAction
=
d
->
mCollection
.
addAction
(
actionName
,
this
,
&
ElisaApplication
::
playPause
);
d
->
mCollection
.
setDefaultShortcut
(
playPauseAction
,
QKeySequence
(
Qt
::
Key_Space
));
}
if
(
actionName
==
QString
Literal
(
"edit_find"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
if
(
actionName
==
Q
Latin1
String
(
"edit_find"
)
&&
KAuthorized
::
authorizeAction
(
actionName
))
{
auto
findAction
=
KStandardAction
::
find
(
this
,
&
ElisaApplication
::
find
,
this
);
d
->
mCollection
.
addAction
(
findAction
->
objectName
(),
findAction
);
}
...
...
@@ -294,7 +294,7 @@ ElisaUtils::EntryDataList ElisaApplication::checkFileListAndMakeAbsolute(const E
auto
newFile
=
QFileInfo
(
std
::
get
<
1
>
(
oneFile
));
if
(
newFile
.
isRelative
())
{
newFile
=
QFileInfo
(
workingDirectory
+
QString
Literal
(
"/"
)
+
std
::
get
<
1
>
(
oneFile
));
newFile
=
QFileInfo
(
workingDirectory
+
Q
Latin1
String
(
"/"
)
+
std
::
get
<
1
>
(
oneFile
));
}
if
(
newFile
.
exists
())
{
...
...
src/filescanner.cpp
View file @
5e0c7685
...
...
@@ -81,7 +81,7 @@ MusicAudioTrack FileScanner::scanOneFile(const QUrl &scanFile, const QMimeDataba
newTrack
.
setResourceURI
(
scanFile
);
const
auto
&
fileMimeType
=
mimeDatabase
.
mimeTypeForFile
(
localFileName
);
if
(
!
fileMimeType
.
name
().
startsWith
(
QString
Literal
(
"audio/"
)))
{
if
(
!
fileMimeType
.
name
().
startsWith
(
Q
Latin1
String
(
"audio/"
)))
{
return
newTrack
;
}
...
...
@@ -242,7 +242,7 @@ QUrl FileScanner::searchForCoverFile(const QString &localFileName)
trackFileDir
.
setNameFilters
(
d
->
constSearchStrings
);
QFileInfoList
coverFiles
=
trackFileDir
.
entryInfoList
();
if
(
coverFiles
.
isEmpty
())
{
QString
dirNamePattern
=
QString
Literal
(
"*"
)
+
trackFileDir
.
dirName
()
+
QString
Literal
(
"*"
);
QString
dirNamePattern
=
Q
Latin1
String
(
"*"
)
+
trackFileDir
.
dirName
()
+
Q
Latin1
String
(
"*"
);
QString
dirNameNoSpaces
=
dirNamePattern
.
remove
(
QLatin1Char
(
' '
));
QStringList
filters
=
{
dirNamePattern
+
QStringLiteral
(
".jpg"
),
...
...
src/localFileConfiguration/localfileconfiguration.cpp
View file @
5e0c7685
...
...
@@ -89,9 +89,9 @@ void KCMElisaLocalFile::setRootPath(QStringList rootPath)
mRootPath
.
clear
();
for
(
const
auto
&
onePath
:
rootPath
)
{
if
(
onePath
.
startsWith
(
QString
Literal
(
"file:///"
)))
{
if
(
onePath
.
startsWith
(
Q
Latin1
String
(
"file:///"
)))
{
mRootPath
.
push_back
(
onePath
.
mid
(
7
));
}
else
if
(
onePath
.
startsWith
(
QString
Literal
(
"file:/"
)))
{
}
else
if
(
onePath
.
startsWith
(
Q
Latin1
String
(
"file:/"
)))
{
mRootPath
.
push_back
(
onePath
.
mid
(
5
));
}
else
{
mRootPath
.
push_back
(
onePath
);
...
...
src/mpris2/mediaplayer2player.cpp
View file @
5e0c7685
...
...
@@ -381,7 +381,7 @@ int MediaPlayer2Player::currentTrack() const
void
MediaPlayer2Player
::
setCurrentTrack
(
int
newTrackPosition
)
{
m_currentTrack
=
m_manageAudioPlayer
->
playerSource
().
toString
();
m_currentTrackId
=
QDBusObjectPath
(
QString
Literal
(
"/org/kde/elisa/playlist/"
)
+
QString
::
number
(
newTrackPosition
)).
path
();
m_currentTrackId
=
QDBusObjectPath
(
Q
Latin1
String
(
"/org/kde/elisa/playlist/"
)
+
QString
::
number
(
newTrackPosition
)).
path
();
emit
currentTrackChanged
();
}
...
...
src/mpris2/mpris2.cpp
View file @
5e0c7685
...
...
@@ -52,9 +52,9 @@ void Mpris2::initDBusService()
// following:
if
(
!
success
)
{
#if defined Q_OS_WIN
success
=
QDBusConnection
::
sessionBus
().
registerService
(
mspris2Name
+
QString
Literal
(
".instance"
)
+
QString
::
number
(
GetCurrentProcessId
()));
success
=
QDBusConnection
::
sessionBus
().
registerService
(
mspris2Name
+
Q
Latin1
String
(
".instance"
)
+
QString
::
number
(
GetCurrentProcessId
()));
#else
success
=
QDBusConnection
::
sessionBus
().
registerService
(
mspris2Name
+
QString
Literal
(
".instance"
)
+
QString
::
number
(
getpid
()));
success
=
QDBusConnection
::
sessionBus
().
registerService
(
mspris2Name
+
Q
Latin1
String
(
".instance"
)
+
QString
::
number
(
getpid
()));
#endif
}
...
...
src/upnp/didlparser.cpp
View file @
5e0c7685
...
...
@@ -383,11 +383,11 @@ void DidlParser::decodeContainerNode(const QDomNode &containerNode, QHash<QStrin
#if 0
const QDomNode &classNode = containerNode.firstChildElement(QStringLiteral("upnp:class"));
if (classNode.toElement().text().startsWith(QString
Literal
("object.container.album.musicAlbum"))) {
if (classNode.toElement().text().startsWith(Q
Latin1
String("object.container.album.musicAlbum"))) {
chilData[ColumnsRoles::ItemClassRole] = DidlParser::Album;
} else if (classNode.toElement().text().startsWith(QString
Literal
("object.container.person.musicArtist"))) {
} else if (classNode.toElement().text().startsWith(Q
Latin1
String("object.container.person.musicArtist"))) {
chilData[ColumnsRoles::ItemClassRole] = DidlParser::Artist;
} else if (classNode.toElement().text().startsWith(QString
Literal
("object.container"))) {
} else if (classNode.toElement().text().startsWith(Q
Latin1
String("object.container"))) {
chilData[ColumnsRoles::ItemClassRole] = DidlParser::Container;
}
#endif
...
...
@@ -446,14 +446,14 @@ void DidlParser::decodeAudioTrackNode(const QDomNode &itemNode, QHash<QString, M
const
QDomNode
&
resourceNode
=
itemNode
.
firstChildElement
(
QStringLiteral
(
"res"
));
if
(
!
resourceNode
.
isNull
())
{
chilData
.
setResourceURI
(
QUrl
::
fromUserInput
(
resourceNode
.
toElement
().
text
()));
if
(
resourceNode
.
attributes
().
contains
(
QString
Literal
(
"duration"
)))
{
if
(
resourceNode
.
attributes
().
contains
(
Q
Latin1
String
(
"duration"
)))
{
const
QDomNode
&
durationNode
=
resourceNode
.
attributes
().
namedItem
(
QStringLiteral
(
"duration"
));
QString
durationValue
=
durationNode
.
nodeValue
();
if
(
durationValue
.
startsWith
(
QString
Literal
(
"0:"
)))
{
durationValue
=
durationValue
.
mid
(
2
);
if
(
durationValue
.
startsWith
(
Q
Latin1
String
(
"0:"
)))
{
durationValue
.
remove
(
0
,
2
);
}
if
(
durationValue
.
contains
(
uint
(
'.'
)))
{
durationValue
=
durationValue
.
split
(
Q
StringLiteral
(
"."
)).
first
();
durationValue
=
durationValue
.
split
(
Q
Latin1Char
(
'.'
)).
first
();
}
chilData
.
setDuration
(
QTime
::
fromString
(
durationValue
,
QStringLiteral
(
"mm:ss"
)));
...
...
@@ -471,7 +471,7 @@ void DidlParser::decodeAudioTrackNode(const QDomNode &itemNode, QHash<QString, M
}
#if 0
if (resourceNode.attributes().contains(QString
Literal
("artist"))) {
if (resourceNode.attributes().contains(Q
Latin1
String("artist"))) {
const QDomNode &artistNode = resourceNode.attributes().namedItem(QStringLiteral("artist"));
//chilData[ColumnsRoles::ArtistRole] = artistNode.nodeValue();
}
...
...
src/upnp/upnpcontentdirectorymodel.cpp
View file @
5e0c7685
...
...
@@ -240,7 +240,7 @@ QModelIndex UpnpContentDirectoryModel::parent(const QModelIndex &child) const
auto
parentInternalId
=
d
->
mUpnpIds
[
parentStringId
];
// special case if we are already at top of model
if
(
parentStringId
==
Q
StringLiteral
(
"0"
))
{
if
(
parentStringId
==
Q
Latin1Char
(
'0'
))
{
return
createIndex
(
0
,
0
,
parentInternalId
);
}
...
...
@@ -325,7 +325,7 @@ void UpnpContentDirectoryModel::fetchMore(const QModelIndex &parent)
return
;
}
if
(
d
->
mData
[
parentInternalId
][
ColumnsRoles
::
IdRole
].
toString
()
==
Q
StringLiteral
(
"0"
))
{
if
(
d
->
mData
[
parentInternalId
][
ColumnsRoles
::
IdRole
].
toString
()
==
Q
Latin1Char
(
'0'
))
{
d
->
mContentDirectory
->
search
(
d
->
mData
[
parentInternalId
][
ColumnsRoles
::
IdRole
].
toString
(),
QStringLiteral
(
"upnp:class derivedfrom
\"
object.container.album
\"
"
),
d
->
mFilter
,
0
,
0
,
d
->
mSortCriteria
);
}
else
{
...
...
@@ -497,11 +497,11 @@ void UpnpContentDirectoryModel::browseFinished(const QString &result, int number
}
const
QDomNode
&
classNode
=
containerNode
.
firstChildElement
(
QStringLiteral
(
"upnp:class"
));
if
(
classNode
.
toElement
().
text
().
startsWith
(
QString
Literal
(
"object.item.audioItem"
)))
{
if
(
classNode
.
toElement
().
text
().
startsWith
(
Q
Latin1
String
(
"object.item.audioItem"
)))
{
chilData
[
ColumnsRoles
::
ItemClassRole
]
=
UpnpContentDirectoryModel
::
AudioTrack
;
}
else
if
(
classNode
.
toElement
().
text
().
startsWith
(
QString
Literal
(
"object.container.album"
)))
{
}
else
if
(
classNode
.
toElement
().
text
().
startsWith
(
Q
Latin1
String
(
"object.container.album"
)))
{
chilData
[
ColumnsRoles
::
ItemClassRole
]
=
UpnpContentDirectoryModel
::
Album
;
}
else
if
(
classNode
.
toElement
().
text
().
startsWith
(
QString
Literal
(
"object.container"
)))
{
}
else
if
(
classNode
.
toElement
().
text
().
startsWith
(
Q
Latin1
String
(
"object.container"
)))
{
chilData
[
ColumnsRoles
::
ItemClassRole
]
=
UpnpContentDirectoryModel
::
Container
;
}
...
...
@@ -557,19 +557,19 @@ void UpnpContentDirectoryModel::browseFinished(const QString &result, int number
const
QDomNode
&
resourceNode
=
itemNode
.
firstChildElement
(
QStringLiteral
(
"res"
));
if
(
!
resourceNode
.
isNull
())
{
chilData
[
ColumnsRoles
::
ResourceRole
]
=
resourceNode
.
toElement
().
text
();
if
(
resourceNode
.
attributes
().
contains
(
QString
Literal
(
"duration"
)))
{
if
(
resourceNode
.
attributes
().
contains
(
Q
Latin1
String
(
"duration"
)))
{
const
QDomNode
&
durationNode
=
resourceNode
.
attributes
().
namedItem
(
QStringLiteral
(
"duration"
));
QString
durationValue
=
durationNode
.
nodeValue
();
if
(
durationValue
.
startsWith
(
QString
Literal
(
"0:"
)))
{
durationValue
=
durationValue
.
mid
(
2
);
if
(
durationValue
.
startsWith
(
Q
Latin1
String
(
"0:"
)))
{
durationValue
.
remove
(
0
,
2
);
}
if
(
durationValue
.
contains
(
uint
(
'.'
)))
{
durationValue
=
durationValue
.
split
(
Q
StringLiteral
(
"."
)).
first
();
durationValue
=
durationValue
.
split
(
Q
Latin1Char
(
'.'
)).
first
();
}
chilData
[
ColumnsRoles
::
DurationRole
]
=
durationValue
;
}
if
(
resourceNode
.
attributes
().
contains
(
QString
Literal
(
"artist"
)))
{
if
(
resourceNode
.
attributes
().
contains
(
Q
Latin1
String
(
"artist"
)))
{
const
QDomNode
&
artistNode
=
resourceNode
.
attributes
().
namedItem
(
QStringLiteral
(
"artist"
));
chilData
[
ColumnsRoles
::
ArtistRole
]
=
artistNode
.
nodeValue
();
}
...
...
@@ -577,11 +577,11 @@ void UpnpContentDirectoryModel::browseFinished(const QString &result, int number
const
QDomNode
&
classNode
=
itemNode
.
firstChildElement
(
QStringLiteral
(
"upnp:class"
));
if
(
!
classNode
.
isNull
())
{
if
(
classNode
.
toElement
().
text
().
startsWith
(
QString
Literal
(
"object.item.audioItem"
)))
{
if
(
classNode
.
toElement
().
text
().
startsWith
(
Q
Latin1
String
(
"object.item.audioItem"
)))
{
chilData
[
ColumnsRoles
::
ItemClassRole
]
=
UpnpContentDirectoryModel
::
AudioTrack
;
}
else
if
(
classNode
.
toElement
().
text
().
startsWith
(
QString
Literal
(
"object.container.album"
)))
{
}
else
if
(
classNode
.
toElement
().
text
().
startsWith
(
Q
Latin1
String
(
"object.container.album"
)))
{
chilData
[
ColumnsRoles
::
ItemClassRole
]
=
UpnpContentDirectoryModel
::
Album
;
}
else
if
(
classNode
.
toElement
().
text
().
startsWith
(
QString
Literal
(
"object.container"
)))
{
}
else
if
(
classNode
.
toElement
().
text
().
startsWith
(
Q
Latin1
String
(
"object.container"
)))
{
chilData
[
ColumnsRoles
::
ItemClassRole
]
=
UpnpContentDirectoryModel
::
Container
;
}
}
...
...
src/upnp/upnpcontrolconnectionmanager.cpp
View file @
5e0c7685
...
...
@@ -124,10 +124,10 @@ void UpnpControlConnectionManager::finishedGetProtocolInfoCall(KDSoapPendingCall
auto answer = self->returnMessage();
auto allValues = answer.childValues();
for (KDSoapValue oneValue : allValues) {
if (oneValue.name() == QString
Literal
("Source")) {
if (oneValue.name() == Q
Latin1
String("Source")) {
d->mSourceProtocolInfo = oneValue.value().toString();
}
if (oneValue.name() == QString
Literal
("Sink")) {
if (oneValue.name() == Q
Latin1
String("Sink")) {
d->mSinkProtocolInfo = oneValue.value().toString();
}
}
...
...
@@ -182,25 +182,25 @@ void UpnpControlConnectionManager::finishedGetCurrentConnectionInfoCall(KDSoapPe
QString connectionStatus;
for (KDSoapValue oneValue : allValues) {
if (oneValue.name() == QString
Literal
("RcsID")) {
if (oneValue.name() == Q
Latin1
String("RcsID")) {
rcsID = oneValue.value().toInt();
}
if (oneValue.name() == QString
Literal
("AVTransportID")) {
if (oneValue.name() == Q
Latin1
String("AVTransportID")) {
avTransportID = oneValue.value().toInt();
}
if (oneValue.name() == QString
Literal
("protocolInfo")) {
if (oneValue.name() == Q
Latin1
String("protocolInfo")) {
protocolInfo = oneValue.value().toInt();
}
if (oneValue.name() == QString
Literal
("PeerConnectionManager")) {
if (oneValue.name() == Q
Latin1
String("PeerConnectionManager")) {
connectionManager = oneValue.value().toInt();
}
if (oneValue.name() == QString
Literal
("PeerConnectionID")) {
if (oneValue.name() == Q
Latin1
String("PeerConnectionID")) {
peerConnectionID = oneValue.value().toInt();
}
if (oneValue.name() == QString
Literal
("Direction")) {
if (oneValue.name() == Q
Latin1
String("Direction")) {
direction = oneValue.value().toInt();
}
if (oneValue.name() == QString
Literal
("Status")) {
if (oneValue.name() == Q
Latin1
String("Status")) {
connectionStatus = oneValue.value().toInt();
}
}
...
...
@@ -224,24 +224,24 @@ void UpnpControlConnectionManager::parseServiceDescription(QIODevice *serviceDes
const
QList
<
QString
>
&
allActions
(
actions
());
d
->
mHasPrepareForConnection
=
allActions
.
contains
(
QString
Literal
(
"PrepareForConnection"
));
d
->
mHasPrepareForConnection
=
allActions
.
contains
(
Q
Latin1
String
(
"PrepareForConnection"
));
Q_EMIT
hasPrepareForConnectionChanged
();
d
->
mHasConnectionComplete
=
allActions
.
contains
(
QString
Literal
(
"ConnectionComplete"
));
d
->
mHasConnectionComplete
=
allActions
.
contains
(
Q
Latin1
String
(
"ConnectionComplete"
));
Q_EMIT
hasConnectionCompleteChanged
();
}
void
UpnpControlConnectionManager
::
parseEventNotification
(
const
QString
&
eventName
,
const
QString
&
eventValue
)
{
if
(
eventName
==
QString
Literal
(
"SourceProtocolInfo"
))
{
if
(
eventName
==
Q
Latin1
String
(
"SourceProtocolInfo"
))
{
d
->
mSourceProtocolInfo
=
eventValue
;
Q_EMIT
sourceProtocolInfoChanged
(
d
->
mSourceProtocolInfo
);
}
if
(
eventName
==
QString
Literal
(
"SinkProtocolInfo"
))
{
if
(
eventName
==
Q
Latin1
String
(
"SinkProtocolInfo"
))
{
d
->
mSinkProtocolInfo
=
eventValue
;
Q_EMIT
sinkProtocolInfoChanged
(
d
->
mSinkProtocolInfo
);
}
if
(
eventName
==
QString
Literal
(
"CurrentConnectionIDs"
))
{
if
(
eventName
==
Q
Latin1
String
(
"CurrentConnectionIDs"
))
{
d
->
mCurrentConnectionIDs
=
eventValue
;
Q_EMIT
currentConnectionIDsChanged
(
d
->
mCurrentConnectionIDs
);
}
...
...
src/upnp/upnpcontrolcontentdirectory.cpp
View file @
5e0c7685
...
...
@@ -123,7 +123,7 @@ void UpnpControlContentDirectory::finishedGetSearchCapabilitiesCall(KDSoapPendin
QString searchCaps;
for (KDSoapValue oneValue : allValues) {
if (oneValue.name() == QString
Literal
("SearchCaps")) {
if (oneValue.name() == Q
Latin1
String("SearchCaps")) {
searchCaps = oneValue.value().toString();
}
}
...
...
@@ -142,7 +142,7 @@ void UpnpControlContentDirectory::finishedGetSortCapabilitiesCall(KDSoapPendingC
QString sortCaps;
for (KDSoapValue oneValue : allValues) {
if (oneValue.name() == QString
Literal
("SortCaps")) {
if (oneValue.name() == Q
Latin1
String("SortCaps")) {
sortCaps = oneValue.value().toString();
}
}
...
...
@@ -160,7 +160,7 @@ void UpnpControlContentDirectory::finishedGetSystemUpdateIDCall(KDSoapPendingCal
auto allValues = answer.childValues();
for (KDSoapValue oneValue : allValues) {
if (oneValue.name() == QString
Literal
("Id")) {
if (oneValue.name() == Q
Latin1
String("Id")) {
d->mSystemUpdateID = oneValue.value().toInt();
}
}
...
...
@@ -182,16 +182,16 @@ void UpnpControlContentDirectory::finishedSearchCall(KDSoapPendingCallWatcher *s
int totalMatches = 0;
for (KDSoapValue oneValue : allValues) {
if (oneValue.name() == QString
Literal
("Result")) {
if (oneValue.name() == Q
Latin1
String("Result")) {
result = oneValue.value().toString();
}
if (oneValue.name() == QString
Literal
("NumberReturned")) {
if (oneValue.name() == Q
Latin1
String("NumberReturned")) {
numberReturned = oneValue.value().toInt();
}
if (oneValue.name() == QString
Literal
("TotalMatches")) {
if (oneValue.name() == Q
Latin1
String("TotalMatches")) {
totalMatches = oneValue.value().toInt();
}
if (oneValue.name() == QString
Literal
("UpdateID")) {
if (oneValue.name() == Q
Latin1
String("UpdateID")) {
d->mSystemUpdateID = oneValue.value().toInt();
}
}
...
...
@@ -215,16 +215,16 @@ void UpnpControlContentDirectory::finishedBrowseCall(KDSoapPendingCallWatcher *s
int totalMatches = 0;
for (KDSoapValue oneValue : allValues) {
if (oneValue.name() == QString
Literal
("Result")) {
if (oneValue.name() == Q
Latin1
String("Result")) {
result = oneValue.value().toString();
}
if (oneValue.name() == QString
Literal
("NumberReturned")) {
if (oneValue.name() == Q
Latin1
String("NumberReturned")) {
numberReturned = oneValue.value().toInt();
}
if (oneValue.name() == QString
Literal
("TotalMatches")) {
if (oneValue.name() == Q
Latin1
String("TotalMatches")) {
totalMatches = oneValue.value().toInt();
}
if (oneValue.name() == QString
Literal
("UpdateID")) {
if (oneValue.name() == Q
Latin1
String("UpdateID")) {
d->mSystemUpdateID = oneValue.value().toInt();
}
}
...
...
@@ -244,7 +244,7 @@ void UpnpControlContentDirectory::parseServiceDescription(QIODevice *serviceDesc
const
QList
<
QString
>
&
allVariables
(
stateVariables
());
d
->
mHasTransferIDs
=
allVariables
.
contains
(
QString
Literal
(
"TransferIDs"
));
d
->
mHasTransferIDs
=
allVariables
.
contains
(
Q
Latin1
String
(
"TransferIDs"
));
Q_EMIT
hasTransferIDsChanged
();
//const QList<QString> &allActions(actions());
...
...
@@ -252,11 +252,11 @@ void UpnpControlContentDirectory::parseServiceDescription(QIODevice *serviceDesc
void
UpnpControlContentDirectory
::
parseEventNotification
(
const
QString
&
eventName
,
const
QString
&
eventValue
)
{
if
(
eventName
==
QString
Literal
(
"TransferIDs"
))
{
if
(
eventName
==
Q
Latin1
String
(
"TransferIDs"
))
{
d
->
mTransferIDs
=
eventValue
;
Q_EMIT
transferIDsChanged
(
d
->
mTransferIDs
);
}
if
(
eventName
==
QString
Literal
(
"SystemUpdateID"
))
{
if
(
eventName
==
Q
Latin1
String
(
"SystemUpdateID"
))
{
d
->
mSystemUpdateID
=
eventValue
.
toInt
();
Q_EMIT
systemUpdateIDChanged
(
d
->
mSystemUpdateID
);
}
...
...