Skip to content

Commit

Permalink
chore: remove useless log
Browse files Browse the repository at this point in the history
Log:
  • Loading branch information
Decodetalkers authored and deepin-bot[bot] committed Aug 2, 2023
1 parent d5ef04c commit c61d988
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 24 deletions.
3 changes: 0 additions & 3 deletions src/service/modules/api/themes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ QVector<QString> ThemesApi::doListTheme(QVector<QString> local, QVector<QString>
QVector<QString> lists = scanThemeDirs(local, type);
QVector<QString> syslists = scanThemeDirs(sys, type);

qInfo() << "doListTheme" << lists.size() << syslists.size() << __FUNCTION__ << __LINE__;

return mergeThemeList(lists, syslists);
}

Expand Down Expand Up @@ -172,7 +170,6 @@ QVector<QString> ThemesApi::scanThemeDirs(QVector<QString> dirs, QString type)

QVector<QString> ThemesApi::mergeThemeList(QVector<QString> src, QVector<QString> target)
{
qInfo() << "mergeThemeList";
if (target.size() == 0) {
return src;
}
Expand Down
2 changes: 0 additions & 2 deletions src/service/modules/background/backgrounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ void Backgrounds::refreshBackground()
{
QStringList files = getCustomBgFiles();
for (auto file : files) {
qInfo() << "custom = " << file << __FUNCTION__ << __LINE__;
Background bg;
bg.setId(utils::enCodeURI(file, SCHEME_FILE));
bg.setDeletable(true);
Expand All @@ -77,7 +76,6 @@ void Backgrounds::refreshBackground()

files = getSysBgFIles();
for (auto file : files) {
qInfo() << "system = " << file << __FUNCTION__ << __LINE__;
Background bg;
bg.setId(utils::enCodeURI(file, SCHEME_FILE));
bg.setDeletable(false);
Expand Down
24 changes: 5 additions & 19 deletions src/service/modules/subthemes/scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#include "scanner.h"

#include "../api/utils.h"
#include "../common/commondefine.h"

Expand Down Expand Up @@ -41,8 +42,7 @@ QString Scanner::query(QString uri)
{
QString path = utils::deCodeURI(uri);
QString mime = queryThemeMime(path);
if(!mime.isEmpty())
{
if (!mime.isEmpty()) {
return mime;
}

Expand Down Expand Up @@ -75,13 +75,11 @@ QString Scanner::doQueryFile(QString file)

GFileInfo *fileinfo = g_file_query_info(g_file, attributes.toLatin1().data(), GFileQueryInfoFlags(G_FILE_QUERY_INFO_NONE), nullptr ,err);
if(err != nullptr){
qInfo() << "g_file_query_info failed" << __FUNCTION__ << __LINE__;
return "";
}

const char *attribute = g_file_info_get_attribute_string(fileinfo, attributes.toLatin1().data());
QString attributeString(attribute);
qInfo() << "attributeString" << attributeString << __FUNCTION__ << __LINE__;

return attributeString;
}
Expand All @@ -94,8 +92,7 @@ bool Scanner::globalTheme(QString file)
return false;
}


if(keyfile.getStr("Deepin Theme","DefaultTheme").isEmpty()) {
if(keyfile.getStr("Deepin Theme", "DefaultTheme").isEmpty()) {
return false;
}

Expand All @@ -115,7 +112,6 @@ bool Scanner::iconTheme(QString file)
return false;
}


if(keyfile.getStr("Icon Theme","Directories").isEmpty()) {
return false;
}
Expand Down Expand Up @@ -188,27 +184,19 @@ QVector<QString> Scanner::listSubDir(QString path)
QFileInfoList filenames = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files);

for(auto filename : filenames) {
qInfo() << "filename = " << filename.filePath() << __FUNCTION__ << __LINE__;
subDirs.push_back(filename.fileName());
}

for(auto sub : subDirs) {
qInfo() << "sub = " << sub << __FUNCTION__ << __LINE__;
}

qInfo() << "sub.size = " << subDirs.size() << __FUNCTION__ << __LINE__;

return subDirs;
}

QVector<QString> Scanner::doListTheme(QString uri, QString ty, Fn fn)
{
QString path = utils::deCodeURI(uri);

qInfo() << "path = " << path << __FUNCTION__ << __LINE__;
QVector<QString> subDirs = listSubDir(path);
if(!subDirs.size()) {
qInfo() << "subDirs is empty";
qInfo() << "Path:" << path << "subDirs is empty";
}

QVector<QString> themes;
Expand All @@ -219,18 +207,16 @@ QVector<QString> Scanner::doListTheme(QString uri, QString ty, Fn fn)
} else {
tmp = path + "/" + subDir + "/index.theme";
}
qInfo() << "subDir = " << subDir << __FUNCTION__ << __LINE__;

if(!fn(tmp) || isHidden(tmp, ty))
continue;
qInfo() << "subDir = " << subDir << __FUNCTION__ << __LINE__;

themes.push_back(tmp);
}

return themes;
}


QVector<QString> Scanner::listGlobalTheme(QString uri)
{
Fn fn = std::bind(&Scanner::isGlobalTheme, this,std::placeholders::_1);
Expand Down

0 comments on commit c61d988

Please sign in to comment.