int ThemesDlg::addTheme(const QString& , const QString &file) { int i = addThemeToList(file); int result = -1; ThemeWidget* w = (ThemeWidget*)(tableThemes->item(i)); if (w) result = w->addInstance(); return result; }
void buildThemesList() { if (themesLoaded) { return; } themesLoaded = true; directoryContents * contents = contentsOfDirectoryAtPath(themesPath, true); themesMenu.entries=NULL; themesMenu.numEntries=0; themesMenu.selectedEntry=0; themesMenu.scrollLocation=0; themesMenu.scrollVelocity=0; themesMenu.scrollBarSize=0; themesMenu.scrollBarPos=0; themesMenu.scrollTarget=0; themesMenu.atEquilibrium=false; menuEntry_s randomEntry; strcpy(randomEntry.name, "Random theme"); strcpy(randomEntry.description, "A random theme will be selected each time the launcher boots. Excludes the default theme."); strcpy(randomEntry.author, ""); memcpy(randomEntry.iconData, settingsIconRandomTheme_bin, sizeof(randomEntry.iconData)); randomEntry.hidden = false; randomEntry.isTitleEntry = false; randomEntry.isShortcut = false; randomEntry.isRegionFreeEntry = false; randomEntry.drawFirstLetterOfName = false; addMenuEntryCopy(&themesMenu, &randomEntry); char * smdhName = "/theme.smdh"; int folderPathLen = strlen(themesPath); int i; for (i=0; i<contents->numPaths; i++) { char * fullPath = contents->paths[i]; static menuEntry_s me; addThemeToList(fullPath, &me, smdhName, folderPathLen); } updateMenuIconPositions(&themesMenu); free(contents); }
void ThemesDlg::addThemeToDialog(const KArchiveDirectory *archiveDir, const QString& destDir) { kDebug() << "addThemeToDialog(): destDir = " << destDir ; QStringList entries = archiveDir->entries(); QStringList::Iterator end(entries.end()); for (QStringList::Iterator it = entries.begin(); it != end; ++it) { if (archiveDir->entry(*it)->isDirectory()) { addThemeToDialog(static_cast<const KArchiveDirectory*>(archiveDir->entry(*it)), destDir + *it + '/'); } else { QFileInfo fi(*it); if (fi.suffix() == "theme") { addThemeToList(destDir + *it); } } } }
void ThemesDlg::addSkzThemeToDialog(const QString &file) { //kDebug() << "addSkzThemeToDialog(): file = " << file ; addThemeToList(file); }