File indexing completed on 2024-12-01 12:35:16
0001 #include <QApplication> 0002 #include <kiconloader.h> 0003 0004 #include <QDate> 0005 #include <QDebug> 0006 #include <QElapsedTimer> 0007 #include <QPixmap> 0008 0009 #include <stdio.h> 0010 #include <stdlib.h> 0011 0012 int main(int argc, char *argv[]) 0013 { 0014 QApplication app(argc, argv); 0015 0016 KIconLoader *mpLoader = KIconLoader::global(); 0017 KIconLoader::Context mContext = KIconLoader::Application; 0018 QElapsedTimer dt; 0019 dt.start(); 0020 int count = 0; 0021 for (int mGroup = 0; mGroup < KIconLoader::LastGroup; ++mGroup) { 0022 qDebug() << "queryIcons " << mGroup << "," << mContext; 0023 const QStringList filelist = mpLoader->queryIcons(mGroup, mContext); 0024 qDebug() << " -> found " << filelist.count() << " icons."; 0025 // int i = 0; 0026 for (const auto &icon : filelist) { 0027 // qDebug() << ( i==9 ? "..." : (*it) ); 0028 mpLoader->loadIcon(icon, (KIconLoader::Group)mGroup); 0029 ++count; 0030 } 0031 } 0032 qDebug() << "Loading " << count << " icons took " << (float)(dt.elapsed()) / 1000 << " seconds"; 0033 }