AdminView::AdminView(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags) { ui.setupUi(this); QObject::connect(ui.pushButton,SIGNAL(clicked()),this,SLOT(reqSmlDesk())); QObject::connect(ui.pushButton_2,SIGNAL(clicked()),this,SLOT(reqMidDesk())); QObject::connect(ui.pushButton_3,SIGNAL(clicked()),this,SLOT(reqBigDesk())); QObject::connect(ui.pushButton_4,SIGNAL(clicked()),this,SLOT(deskIn())); QObject::connect(ui.pushButton_5,SIGNAL(clicked()),this,SLOT(popDrop())); QObject::connect(ui.pushButton_6,SIGNAL(clicked()),this,SLOT(deskPay())); QObject::connect(ui.pushButton_7,SIGNAL(clicked()),this,SLOT(writeDaily())); QObject::connect(ui.pushButton_8,SIGNAL(clicked()),this,SLOT(browseData())); }
void ProfileUpdater::copyDataToProfile() { QDir profileDir(m_profilePath); profileDir.mkdir("certificates"); QFile browseData(m_profilePath + "browsedata.db"); if (browseData.exists()) { const QString &browseDataBackup = qz_ensureUniqueFilename(m_profilePath + "browsedata-backup.db"); const QString &settingsBackup = qz_ensureUniqueFilename(m_profilePath + "settings-backup.ini"); browseData.copy(browseDataBackup); QFile(m_profilePath + "settings.ini").copy(settingsBackup); const QString &text = "Incompatible profile version has been detected. To avoid losing your profile data, they were " "backed up in following directories:<br/><br/><b>" + browseDataBackup + "<br/>" + settingsBackup + "<br/></b>"; QMessageBox::warning(0, "QupZilla: Incompatible profile version", text); } browseData.remove(); QFile(":data/browsedata.db").copy(m_profilePath + "browsedata.db"); QFile(m_profilePath + "browsedata.db").setPermissions(QFile::ReadUser | QFile::WriteUser); }
void ProfileManager::copyDataToProfile() { QDir profileDir(DataPaths::currentProfilePath()); QFile browseData(profileDir.filePath(QLatin1String("browsedata.db"))); if (browseData.exists()) { const QString browseDataBackup = QzTools::ensureUniqueFilename(profileDir.filePath(QLatin1String("browsedata-backup.db"))); browseData.copy(browseDataBackup); const QString text = "Incompatible profile version has been detected. To avoid losing your profile data, they were " "backed up in following file:<br/><br/><b>" + browseDataBackup + "<br/></b>"; QMessageBox::warning(0, "QupZilla: Incompatible profile version", text); } browseData.remove(); QFile(QLatin1String(":data/browsedata.db")).copy(profileDir.filePath(QLatin1String("browsedata.db"))); QFile(profileDir.filePath(QLatin1String("browsedata.db"))).setPermissions(QFile::ReadUser | QFile::WriteUser); // Reconnect database connectDatabase(); }