QString ApplicationInfo::vCardDir() { QDir vcard(pathToProfile(activeProfile) + "/vcard"); if (!vcard.exists()) { QDir profile(pathToProfile(activeProfile)); profile.mkdir("vcard"); } return vcard.path(); }
QString ApplicationInfo::historyDir() { QDir history(pathToProfile(activeProfile) + "/history"); if (!history.exists()) { QDir profile(pathToProfile(activeProfile)); profile.mkdir("history"); } return history.path(); }
void ProfileNewDlg::slotCreate() { name = le_name->text(); if(profileExists(name)) { QMessageBox::information(this, CAP(tr("New Profile")), tr("There is already an existing profile with this name. Please choose another.")); return; } if(!profileNew(name)) { QMessageBox::information(this, CAP(tr("New Profile")), tr("Unable to create the profile. Please do not use any special characters.")); return; } // save config PsiOptions o; if (!o.newProfile()) { qWarning("ERROR: Failed to new profile default options"); } o.setOption("options.messages.default-outgoing-message-type" ,rb_message->isChecked() ? "message": "chat"); o.setOption("options.ui.emoticons.use-emoticons" ,ck_useEmoticons->isChecked()); o.save(pathToProfile(name, ApplicationInfo::ConfigLocation) + "/options.xml"); accept(); }
QString ApplicationInfo::makeSubprofilePath(const QString &path, ApplicationInfo::HomedirType type) { if (path.indexOf("..") == -1) { // ensure its in profile dir QDir dir(pathToProfile(activeProfile, type) + "/" + path); if (!dir.exists()) { dir.mkpath("."); } return dir.path(); } return QString(); }
QString ApplicationInfo::currentProfileDir(ApplicationInfo::HomedirType type) { return pathToProfile(activeProfile, type); }