kexi
kexinewstuff.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifdef HAVE_KNEWSTUFF
00021
00022 #include <kdebug.h>
00023 #include <ktar.h>
00024 #include <qdir.h>
00025 #include <kaction.h>
00026 #include <kapplication.h>
00027 #include <kfiledialog.h>
00028 #include <klocale.h>
00029 #include <kdeversion.h>
00030
00031 #include "kexinewstuff.h"
00032
00033 KexiNewStuff::KexiNewStuff(QWidget *parent)
00034 : KNewStuff( "kexi/template"
00035 #if KDE_IS_VERSION(3,3,0)
00036 , "http://download.kde.org/khotnewstuff/kexi-providers.xml"
00037 #endif
00038 , parent)
00039 {
00040
00041
00042
00043
00044 KGlobal::config()->deleteGroup("KNewStuffStatus");
00045 }
00046
00047 KexiNewStuff::~KexiNewStuff()
00048 {
00049 }
00050
00051 bool
00052 KexiNewStuff::install(const QString &fileName)
00053 {
00054 kdDebug() << "KexiNewStuff::install(): " << fileName << endl;
00055
00056 KTar archive( fileName );
00057 if ( !archive.open( IO_ReadOnly ) ) {
00058 kdDebug() << QString("KexiNewStuff::install: Failed to open archivefile \"%1\"").arg(fileName) << endl;
00059 return false;
00060 }
00061 const KArchiveDirectory *archiveDir = archive.directory();
00062 const QString destDir = KFileDialog::getExistingDirectory(
00063 ":DownloadExampleDatabases", parentWidget(),
00064 i18n("Choose Directory Where to Install Example Database"));
00065 if (destDir.isEmpty()) {
00066 kdDebug() << QString("KexiNewStuff::install: Destination-directory is empty.") << endl;
00067 return false;
00068 }
00069 archiveDir->copyTo(destDir);
00070 archive.close();
00071
00072 return true;
00073 }
00074
00075 bool
00076 KexiNewStuff::createUploadFile(const QString &)
00077 {
00078 return true;
00079 }
00080
00081 #endif
|