From 5a062c388eaacd8b9e900333cf7a496034169f3e Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 12 Apr 2018 15:09:28 -0400 Subject: Add a quick test script I wrote to probe icon themes and see what is found or not. --- dev-tools/iconprobe/main.cpp | 77 ++++++++++++++++++++++++++++++++++++++++++++ dev-tools/iconprobe/test.pro | 12 +++++++ 2 files changed, 89 insertions(+) create mode 100644 dev-tools/iconprobe/main.cpp create mode 100644 dev-tools/iconprobe/test.pro (limited to 'dev-tools') diff --git a/dev-tools/iconprobe/main.cpp b/dev-tools/iconprobe/main.cpp new file mode 100644 index 00000000..694292c3 --- /dev/null +++ b/dev-tools/iconprobe/main.cpp @@ -0,0 +1,77 @@ +#include +#include +#include +#include +#include +#include + +QString findInDir(QString dir, QString file){ + QDir _dir(dir); + QStringList files = _dir.entryList(QStringList() << file+".*", QDir::Files | QDir::NoDotAndDotDot, QDir::Name); + if(files.isEmpty()){ + QStringList dirs = _dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name); + QString tmp; + for(int i=0; i Date: Tue, 17 Apr 2018 10:27:22 -0400 Subject: Fix up the detection of icons in LFileInfo. Add a large failover system where a list of possible icons are created, and the first one which exists in the theme is used. Also update the iconprobe dev tool a but: make it take an optional list of icons as input --- dev-tools/iconprobe/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'dev-tools') diff --git a/dev-tools/iconprobe/main.cpp b/dev-tools/iconprobe/main.cpp index 694292c3..06599bf7 100644 --- a/dev-tools/iconprobe/main.cpp +++ b/dev-tools/iconprobe/main.cpp @@ -51,7 +51,9 @@ int main(int argc, char ** argv) QApplication a(argc, argv); QString icondir="/usr/local/share/icons"; - QStringList iconfiles; iconfiles << "user-home" << "falkon" << "firefox" << "utilities-terminal"; + QStringList iconfiles; + if(argc<2){ iconfiles << "folder-downloads" << "start-here-lumina" << "firefox" << "utilities-terminal"; } + else{ iconfiles = QString(argv[1]).split(" "); } QDir dir(icondir); QStringList themes = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name); @@ -69,6 +71,7 @@ int main(int argc, char ** argv) qDebug() << " -------------------------"; qDebug() << " - Looking for icon:" << iconfiles[j]; qDebug() << " - Found File:" << findInDir(themepath, iconfiles[j]); + qDebug() << " - Has Theme Icon:" << QIcon::hasThemeIcon(iconfiles[j]); qDebug() << " - Found Icon:" << QIcon::fromTheme(iconfiles[j]).name(); } qDebug() << " ================"; -- cgit