diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2021-01-30 18:27:00 +0200 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2021-01-30 18:27:00 +0200 |
commit | cbf067eac1f1f2077ae06b99698df674330f4313 (patch) | |
tree | da1fe02d6b14e52aad6f9d1a85087c1fb9e2394c /src/klamav.cpp | |
parent | 3a5d06908cf1044a0ef68580c12c1deedb8257f7 (diff) | |
download | klamav-cbf067eac1f1f2077ae06b99698df674330f4313.tar.gz klamav-cbf067eac1f1f2077ae06b99698df674330f4313.zip |
Reworked First-Run Wizard.
It was made more compact because it doesn't make sense to have a
full-blown two-page wizard for setting up two paths and showing a
checkbox.
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'src/klamav.cpp')
-rw-r--r-- | src/klamav.cpp | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/src/klamav.cpp b/src/klamav.cpp index df62cef..c09a9f9 100644 --- a/src/klamav.cpp +++ b/src/klamav.cpp @@ -346,52 +346,51 @@ void Klamav::firstRunWizard() { TQString homepath = getenv("HOME"); TQString defaultdb = homepath + "/.klamav/database"; TQString defaultquar = homepath + "/.klamav/quarantine"; - if( wizard.exec() != TQDialog::Rejected ){ - TDEConfig* config = TDEGlobal::config(); + // Execute wizard + wizard.exec(); - config->setGroup("Freshklam"); + // These are run after the wizard is finished + TDEConfig* config = TDEGlobal::config(); + + config->setGroup("Freshklam"); - TQString wizardDBPath = wizard.databasePath().path(-1); - TQString wizardTQRPath = wizard.quarantinePath().path(-1); -/* kdDebug() << wizard.databasePath() << endl; - kdDebug() << wizard.defaultDatabasePath() << endl;*/ - //Configure Database Path - TQStringList lastDownloadPaths; - if ((wizardDBPath != "") && (TQDir::cleanDirPath(wizardDBPath) != defaultdb)){ - lastDownloadPaths.prepend( TQString("%1").arg(wizardDBPath)); - checkDir(wizardDBPath); - }else{ - lastDownloadPaths.prepend( TQString("%1").arg(wizard.defaultDatabasePath())); - createDefaultKlamAVDir("database"); - } - config->writeEntry("lastDownloadPaths", lastDownloadPaths); - config->sync(); - //Configure Quarantine Path - TQStringList lastQuarLocations; + TQString wizardDBPath = wizard.databasePath().path(-1); + TQString wizardTQRPath = wizard.quarantinePath().path(-1); + + //Configure Database Path + TQStringList lastDownloadPaths; + if ((wizardDBPath != "") && (TQDir::cleanDirPath(wizardDBPath) != defaultdb)){ + lastDownloadPaths.prepend( TQString("%1").arg(wizardDBPath)); + checkDir(wizardDBPath); + }else{ + lastDownloadPaths.prepend( TQString("%1").arg(wizard.defaultDatabasePath())); + createDefaultKlamAVDir("database"); + } + config->writeEntry("lastDownloadPaths", lastDownloadPaths); + config->sync(); + + //Configure Quarantine Path + TQStringList lastQuarLocations; - config->setGroup("Kuarantine"); + config->setGroup("Kuarantine"); -/* kdDebug() << wizard.quarantinePath() << endl; - kdDebug() << wizard.defaultQuarantinePath() << endl; - kdDebug() << defaultquar << endl;*/ - if ((wizardTQRPath != "") && (TQDir::cleanDirPath(wizardTQRPath) != defaultquar)){ - lastQuarLocations.prepend( TQString("%1").arg(wizardTQRPath)); - checkDir(wizardTQRPath); - }else{ - lastQuarLocations.prepend( TQString("%1").arg(wizard.defaultQuarantinePath())); - createDefaultKlamAVDir("quarantine"); - } - config->writeEntry("KuarantineLocations", lastQuarLocations); - config->sync(); - - if (wizard.downloadDatabase()){ - kdDebug() << "downloading database" << endl; - downloadDBForWizard = true; - } + if ((wizardTQRPath != "") && (TQDir::cleanDirPath(wizardTQRPath) != defaultquar)){ + lastQuarLocations.prepend( TQString("%1").arg(wizardTQRPath)); + checkDir(wizardTQRPath); + }else{ + lastQuarLocations.prepend( TQString("%1").arg(wizard.defaultQuarantinePath())); + createDefaultKlamAVDir("quarantine"); + } + config->writeEntry("KuarantineLocations", lastQuarLocations); + config->sync(); + if (wizard.downloadDatabase()){ + kdDebug() << "downloading database" << endl; + downloadDBForWizard = true; } + } void Klamav::createDefaultKlamAVDir(TQString type){ |