void GFF3File::load(uint32 id) { try { loadHeader(id); loadStructs(); loadLists(); } catch (Common::Exception &e) { clear(); e.add("Failed reading GFF3 file"); throw; } }
bool GmailNotifyPlugin::enable() { enabled = true; optionsApplingInProgress_ = false; id_.clear(); accounts.clear(); mailItems_.clear(); actions_ = new ActionsList(this); connect(actions_, SIGNAL(changeNoSaveState(int,QString,bool)), this, SLOT(changeNoSaveState(int,QString,bool))); QFile f(":/icons/gmailnotify.png"); if(f.open(QIODevice::ReadOnly)) iconHost->addIcon("gmailnotify/menu", f.readAll()); f.close(); f.setFileName(":/icons/nohistory.png"); if(f.open(QIODevice::ReadOnly)) iconHost->addIcon("gmailnotify/nohistory", f.readAll()); f.close(); soundFile = psiOptions->getPluginOption(OPTION_SOUND, soundFile).toString(); loadLists(); int interval = psiOptions->getPluginOption(OPTION_INTERVAL, QVariant(4000)).toInt()/1000; popupId = popup->registerOption(POPUP_OPTION, interval, "plugins.options."+shortName()+"."+OPTION_INTERVAL); program_ = psiOptions->getPluginOption(OPTION_PROG).toString(); //Update features bool end = false; int acc = 0; while(!end) { QString jid = accInfo->getJid(acc); if(jid == "-1") { end = true; continue; } QStringList l = jid.split("@"); QString domain = l.last().split("/").first(); QString id = stanzaSender->uniqueId(acc); id_.append(id); if(accInfo->getStatus(acc) != "offline") stanzaSender->sendStanza(acc, QString("<iq type='get' to='%1' id='%2' ><query xmlns='http://jabber.org/protocol/disco#info'/></iq>") .arg(domain) .arg(id)); acc++; } return true; }
KeyboardLayoutConfig::KeyboardLayoutConfig(LXQt::Settings* _settings, QWidget* parent): QWidget(parent), settings(_settings) { ui.setupUi(this); loadLists(); loadSettings(); initControls(); connect(ui.addLayout, SIGNAL(clicked(bool)), SLOT(onAddLayout())); connect(ui.removeLayout, SIGNAL(clicked(bool)), SLOT(onRemoveLayout())); connect(ui.moveUp, SIGNAL(clicked(bool)), SLOT(onMoveUp())); connect(ui.moveDown, SIGNAL(clicked(bool)), SLOT(onMoveDown())); connect(ui.keyboardModel, SIGNAL(currentIndexChanged(int)), SLOT(accept())); connect(ui.switchKey, SIGNAL(currentIndexChanged(int)), SLOT(accept())); }
PlistsGroup::PlistsGroup(QObject *parent) : QObject(parent) { if(m_instance) qFatal("Only one instance of PlistsGroup object is allowed"); m_instance = this; m_Settings = Settings::instance(); m_Auth = Auth::instance(); // Create new widget for playlist m_widget = new PlistsGroupWidget(); // init vars m_LastList = 0; m_LastTrack = 0; m_bLoadMeta = false; m_bUseMeta = false; m_shuffleMode = m_Settings->getValue("player/shuffle").toInt(); m_repeatMode = m_Settings->getValue("player/repeat").toInt(); connect(m_widget, SIGNAL(createSearchList()), SLOT(createSearchList())); connect(m_widget, SIGNAL(createLibraryList()), SLOT(createLibraryList())); connect(m_widget, SIGNAL(createLocalList()), SLOT(createLocalList())); connect(m_widget, SIGNAL(createSuggestionsList()), SLOT(createSuggestionsList())); connect(m_widget, SIGNAL(createDbSearch()), SLOT(createDbSearch())); connect(m_widget, SIGNAL(tabMoved(int,int)), SLOT(listSwap(int,int))); connect(m_widget, SIGNAL(removeTab(int)), SLOT(deleteList(int))); connect(m_widget, SIGNAL(renameTab(int, QString)), SLOT(renameList(int, QString))); loadLists(); if(m_LastList) connect(this, SIGNAL(playLast()), m_LastList, SLOT(playLast())); if(m_Settings->getValue("playing/play_on_start").toBool() && m_LastList) QTimer::singleShot(200, m_LastList, SLOT(playLast())); }
int main(int argc, char* argv[]) { int result = 0; /* FileStream *out; */ UPKGOptions o; CharList *tail; UBool needsHelp = FALSE; UErrorCode status = U_ZERO_ERROR; /* char tmp[1024]; */ uint32_t i; int32_t n; U_MAIN_INIT_ARGS(argc, argv); progname = argv[0]; options[MODE].value = "common"; /* read command line options */ argc=u_parseArgs(argc, argv, sizeof(options)/sizeof(options[0]), options); /* error handling, printing usage message */ /* I've decided to simply print an error and quit. This tool has too many options to just display them all of the time. */ if(options[HELP].doesOccur || options[HELP_QUESTION_MARK].doesOccur) { needsHelp = TRUE; } else { if(!needsHelp && argc<0) { fprintf(stderr, "%s: error in command line argument \"%s\"\n", progname, argv[-argc]); fprintf(stderr, "Run '%s --help' for help.\n", progname); return 1; } #ifndef WINDOWS_WITH_MSVC if(!options[BLDOPT].doesOccur) { if (pkg_getOptionsFromICUConfig(&options[BLDOPT]) != 0) { fprintf(stderr, " required parameter is missing: -O is required \n"); fprintf(stderr, "Run '%s --help' for help.\n", progname); return 1; } } #else if(options[BLDOPT].doesOccur) { fprintf(stdout, "Warning: You are using the -O option which is not needed for MSVC build on Windows.\n"); } #endif if(!options[NAME].doesOccur) /* -O we already have - don't report it. */ { fprintf(stderr, " required parameter -p is missing \n"); fprintf(stderr, "Run '%s --help' for help.\n", progname); return 1; } if(argc == 1) { fprintf(stderr, "No input files specified.\n" "Run '%s --help' for help.\n", progname); return 1; } } /* end !needsHelp */ if(argc<0 || needsHelp ) { fprintf(stderr, "usage: %s [-options] [-] [packageFile] \n" "\tProduce packaged ICU data from the given list(s) of files.\n" "\t'-' by itself means to read from stdin.\n" "\tpackageFile is a text file containing the list of files to package.\n", progname); fprintf(stderr, "\n options:\n"); for(i=0;i<(sizeof(options)/sizeof(options[0]));i++) { fprintf(stderr, "%-5s -%c %s%-10s %s\n", (i<1?"[REQ]":""), options[i].shortName, options[i].longName ? "or --" : " ", options[i].longName ? options[i].longName : "", options_help[i]); } fprintf(stderr, "modes: (-m option)\n"); for(i=0;i<(sizeof(modes)/sizeof(modes[0]));i++) { fprintf(stderr, " %-9s ", modes[i].name); if (modes[i].alt_name) { fprintf(stderr, "/ %-9s", modes[i].alt_name); } else { fprintf(stderr, " "); } fprintf(stderr, " %s\n", modes[i].desc); } return 1; } /* OK, fill in the options struct */ uprv_memset(&o, 0, sizeof(o)); o.mode = options[MODE].value; o.version = options[REVISION].doesOccur ? options[REVISION].value : 0; o.shortName = options[NAME].value; { int32_t len = (int32_t)uprv_strlen(o.shortName); char *csname, *cp; const char *sp; cp = csname = (char *) uprv_malloc((len + 1 + 1) * sizeof(*o.cShortName)); if (*(sp = o.shortName)) { *cp++ = isalpha(*sp) ? * sp : '_'; for (++sp; *sp; ++sp) { *cp++ = isalnum(*sp) ? *sp : '_'; } } *cp = 0; o.cShortName = csname; } if(options[LIBNAME].doesOccur) { /* get libname from shortname, or explicit -L parameter */ o.libName = options[LIBNAME].value; } else { o.libName = o.shortName; } if(options[QUIET].doesOccur) { o.quiet = TRUE; } else { o.quiet = FALSE; } o.verbose = options[VERBOSE].doesOccur; #ifndef WINDOWS_WITH_MSVC /* on UNIX, we'll just include the file... */ o.options = options[BLDOPT].value; #endif if(options[COPYRIGHT].doesOccur) { o.comment = U_COPYRIGHT_STRING; } else if (options[COMMENT].doesOccur) { o.comment = options[COMMENT].value; } if( options[DESTDIR].doesOccur ) { o.targetDir = options[DESTDIR].value; } else { o.targetDir = "."; /* cwd */ } o.rebuild = options[REBUILD].doesOccur; if( options[TEMPDIR].doesOccur ) { o.tmpDir = options[TEMPDIR].value; } else { o.tmpDir = o.targetDir; } if( options[INSTALL].doesOccur ) { o.install = options[INSTALL].value; } else { o.install = NULL; } if( options[SOURCEDIR].doesOccur ) { o.srcDir = options[SOURCEDIR].value; } else { o.srcDir = "."; } if( options[ENTRYPOINT].doesOccur ) { o.entryName = options[ENTRYPOINT].value; } else { o.entryName = o.cShortName; } /* OK options are set up. Now the file lists. */ tail = NULL; for( n=1; n<argc; n++) { o.fileListFiles = pkg_appendToList(o.fileListFiles, &tail, uprv_strdup(argv[n])); } /* load the files */ loadLists(&o, &status); if( U_FAILURE(status) ) { fprintf(stderr, "error loading input file lists: %s\n", u_errorName(status)); return 2; } result = pkg_executeOptions(&o); if (pkgDataFlags != NULL) { for (n = 0; n < PKGDATA_FLAGS_SIZE; n++) { if (pkgDataFlags[n] != NULL) { uprv_free(pkgDataFlags[n]); } } uprv_free(pkgDataFlags); } if (o.cShortName != NULL) { uprv_free((char *)o.cShortName); } if (o.fileListFiles != NULL) { pkg_deleteList(o.fileListFiles); } if (o.filePaths != NULL) { pkg_deleteList(o.filePaths); } if (o.files != NULL) { pkg_deleteList(o.files); } return result; }
SearchBlacklist::SearchBlacklist() { list[NAME] = QList<QString>(); list[TTH] = QList<QString>(); loadLists(); }