Commit 1a1e5c98 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Fix some compiler warnings

parent c12cea55
......@@ -109,7 +109,8 @@ void FileItemLinkingPluginActionLoader::run()
QSqlField field;
field.setType(QVariant::String);
for (const auto& item: items.urlList()) {
const auto urlList = items.urlList();
for (const auto& item: urlList) {
field.setValue(QFileInfo(item.toLocalFile()).canonicalFilePath());
escapedFiles << database.driver()->formatValue(field);
}
......
......@@ -192,7 +192,8 @@ uint ArchiveProtocolBase::computeArchiveDirSize(const KArchiveDirectory *dir)
{
// compute size of archive content
uint totalSize = 0;
for (const auto entryName: dir->entries()) {
const auto entries = dir->entries();
for (const auto &entryName: entries) {
auto entry = dir->entry(entryName);
if (entry->isFile()) {
auto fileEntry = static_cast<const KArchiveFile *>(entry);
......
......@@ -60,7 +60,6 @@ void BookmarksProtocol::echoImage( const QString &type, const QString &string, c
QPainter painter(&pix);
painter.setOpacity(0.3);
QRectF rect(0, 0, size, size);
painter.drawPixmap(pix.rect(), icon.pixmap(size, size), pix.rect());
}
......
......@@ -1680,7 +1680,6 @@ void fishProtocol::special( const QByteArray &data ){
{
QUrl u;
QString command;
QString tempfile;
stream >> u;
stream >> command;
myDebug( << "@@@@@@@@@ exec " << u << " " << command);
......
......@@ -849,9 +849,6 @@ void MANProtocol::constructPath(QStringList& constr_path, QStringList constr_cat
// The entry is "MANDB_MAP <manpath> <catmanpath>"
const QRegularExpression mandb_map_regex("^MANDB_MAP\\s+(\\S+)\\s+(\\S+)");
//QRegExp section_regex( "^SECTION\\s" );
const QRegularExpression space_regex("\\s+"); // for parsing manpath map
QFile mc("/etc/man.conf"); // Caldera
if (!mc.exists())
mc.setFileName("/etc/manpath.config"); // SuSE, Debian
......@@ -1009,8 +1006,6 @@ void MANProtocol::checkManPaths()
QStringList constr_path;
QStringList constr_catmanpath; // catmanpath
QString conf_section;
if ( construct_path )
{
constructPath(constr_path, constr_catmanpath);
......
......@@ -90,6 +90,7 @@ void DNSSDNetworkBuilder::addServiceType( const QString& serviceType )
void DNSSDNetworkBuilder::removeServiceType( const QString& serviceType )
{
Q_UNUSED(serviceType)
// for now we keep the service browser (aren't that many) because otherwise
// the serviceRemoved calls won't reach us.
// we could also go through all the devices and remove the services manually as a fix
......
......@@ -240,7 +240,7 @@ void UpnpNetworkBuilder::removeUPnPDevices( const QList<Cagibi::Device>& upnpDev
if( device.ipAddress() == ipAddress )
{
QString id;
for (const UpnpNetSystemAble* factory : mNetSystemFactoryList) {
for (const UpnpNetSystemAble* factory : qAsConst(mNetSystemFactoryList)) {
if( factory->canCreateNetSystemFromUpnp(upnpDevice) )
{
id = factory->upnpId( upnpDevice );
......
......@@ -54,7 +54,7 @@ bool RecentDocuments::rewriteUrl(const QUrl& url, QUrl& newUrl)
if (isRootUrl(url)) {
return false;
} else {
QString desktopFilePath = QString("%1/%2.desktop").arg(KRecentDocument::recentDocumentDirectory()).arg(url.path());
const QString desktopFilePath = QString("%1/%2.desktop").arg(KRecentDocument::recentDocumentDirectory(), url.path());
if (KDesktopFile::isDesktopFile(desktopFilePath)) {
KDesktopFile file(desktopFilePath);
if (file.hasLinkType())
......
......@@ -139,7 +139,6 @@ void SettingsProtocol::stat(const QUrl& url)
QHash<QString, KService::Ptr>::const_iterator it = m_categoryLookup.constFind(fileName);
if (it != m_categoryLookup.constEnd()) {
const KService::Ptr service = it.value();
const QString parentCategory = service->property("X-KDE-System-Settings-Parent-Category").toString();
const QString category = service->property("X-KDE-System-Settings-Category").toString();
createDirEntry(entry, category, service->icon());
entry.fastInsert(KIO::UDSEntry::UDS_DISPLAY_NAME, service->name());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment