Guest User

Untitled

a guest
Apr 21st, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.83 KB | None | 0 0
  1. diff --git a/kdecore/tests/kdirwatch_unittest.cpp b/kdecore/tests/kdirwatch_unittest.cpp
  2. index f743cf2..8fd602e 100644
  3. --- a/kdecore/tests/kdirwatch_unittest.cpp
  4. +++ b/kdecore/tests/kdirwatch_unittest.cpp
  5. @@ -22,7 +22,7 @@
  6. #include <kconfiggroup.h>
  7. #include <QDir>
  8. #include <kdebug.h>
  9. -#include <ktempdir.h>
  10. +#include <qtemporarydir.h>
  11. #include <qtest_kde.h>
  12. #include <qtestevent.h>
  13. #include <kdirwatch.h>
  14. @@ -60,8 +60,7 @@ class KDirWatch_UnitTest : public QObject
  15. public:
  16. KDirWatch_UnitTest()
  17. {
  18. - m_path = m_tempDir.name();
  19. - Q_ASSERT(m_path.endsWith('/'));
  20. + m_path = m_tempDir.path() + '/';
  21.  
  22. KConfigGroup config(KGlobal::config(), "DirWatch");
  23. const QByteArray testMethod = qgetenv("KDIRWATCHTEST_METHOD");
  24. @@ -116,7 +115,7 @@ private:
  25. void appendToFile(const QString& path);
  26. void appendToFile(int num);
  27.  
  28. - KTempDir m_tempDir;
  29. + QTemporaryDir m_tempDir;
  30. QString m_path;
  31. bool m_slow;
  32. };
  33. @@ -517,14 +516,14 @@ void KDirWatch_UnitTest::testDeleteAndRecreateDir()
  34. {
  35. // Like KDirModelTest::testOverwriteFileWithDir does at the end.
  36. // The linux-2.6.31 bug made kdirwatch emit deletion signals about the -new- dir!
  37. - KTempDir* tempDir1 = new KTempDir(KStandardDirs::locateLocal("tmp", "olddir-"));
  38. + QTemporaryDir* tempDir1 = new QTemporaryDir(QDir::tempPath() + QLatin1Char('/') + "olddir-");
  39. KDirWatch watch;
  40. - const QString path1 = tempDir1->name();
  41. + const QString path1 = tempDir1->path() + '/';
  42. watch.addDir(path1);
  43.  
  44. delete tempDir1;
  45. - KTempDir* tempDir2 = new KTempDir(KStandardDirs::locateLocal("tmp", "newdir-"));
  46. - const QString path2 = tempDir2->name();
  47. + QTemporaryDir* tempDir2 = new QTemporaryDir(QDir::tempPath() + QLatin1Char('/') + "newdir-");
  48. + const QString path2 = tempDir2->path() + '/';
  49. watch.addDir(path2);
  50.  
  51. QVERIFY(waitForOneSignal(watch, SIGNAL(deleted(QString)), path1));
  52. diff --git a/kutils/CMakeLists.txt b/kutils/CMakeLists.txt
  53. index bfbc698..12d6e41 100644
  54. --- a/kutils/CMakeLists.txt
  55. +++ b/kutils/CMakeLists.txt
  56. @@ -6,6 +6,8 @@ include_directories( ${KDE4_KDEUI_INCLUDES}
  57. ${karchive_BINARY_DIR}/src
  58. ${CMAKE_SOURCE_DIR}/tier1/libkauth/
  59. ${CMAKE_BINARY_DIR}/tier1/libkauth/
  60. + ${CMAKE_SOURCE_DIR}/libinqt5/src
  61. + ${CMAKE_BINARY_DIR}/libinqt5/src
  62. )
  63.  
  64. ########### kemoticons ################
  65. diff --git a/kutils/kprintpreview.cpp b/kutils/kprintpreview.cpp
  66. index 4aa4e29..fc997f6 100644
  67. --- a/kutils/kprintpreview.cpp
  68. +++ b/kutils/kprintpreview.cpp
  69. @@ -23,13 +23,13 @@
  70. #include <QtGui/QLabel>
  71. #include <QtGui/QPrinter>
  72. #include <QtGui/QShowEvent>
  73. +#include <qtemporarydir.h>
  74.  
  75. #include <kmimetypetrader.h>
  76. #include <kparts/part.h>
  77. #include <kpluginfactory.h>
  78. #include <kpluginloader.h>
  79. #include <kservice.h>
  80. -#include <ktempdir.h>
  81. #include <kdebug.h>
  82.  
  83.  
  84. @@ -43,8 +43,8 @@ public:
  85. , previewPart(0)
  86. , failMessage(0)
  87. {
  88. - if ( tempdir.exists() ) {
  89. - filename = tempdir.name() + "print_preview.pdf";
  90. + if ( tempdir.isValid() ) {
  91. + filename = tempdir.path() + '/' + "print_preview.pdf";
  92. } else {
  93. // XXX: not portable!
  94. kWarning() << "Failed to create temporary directory";
  95. @@ -61,7 +61,7 @@ public:
  96. QPrinter *printer;
  97. QWidget *mainWidget;
  98.  
  99. - KTempDir tempdir;
  100. + QTemporaryDir tempdir;
  101. QString filename;
  102.  
  103. KParts::ReadOnlyPart *previewPart;
  104. diff --git a/nepomuk/test/CMakeLists.txt b/nepomuk/test/CMakeLists.txt
  105. index e7ece33..e771425 100644
  106. --- a/nepomuk/test/CMakeLists.txt
  107. +++ b/nepomuk/test/CMakeLists.txt
  108. @@ -4,6 +4,9 @@ set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
  109.  
  110. include_directories(
  111. ${CMAKE_CURRENT_BINARY_DIR}/..
  112. + ${CMAKE_SOURCE_DIR}/libinqt5/src
  113. + ${CMAKE_BINARY_DIR}/libinqt5/src
  114. +
  115. )
  116.  
  117. add_definitions(-DDISABLE_NEPOMUK_LEGACY=1)
  118. diff --git a/nepomuk/test/dynamicresourcefacettest.cpp b/nepomuk/test/dynamicresourcefacettest.cpp
  119. index 6dd2cb0..1d6eae4 100644
  120. --- a/nepomuk/test/dynamicresourcefacettest.cpp
  121. +++ b/nepomuk/test/dynamicresourcefacettest.cpp
  122. @@ -122,8 +122,10 @@ void DynamicResourceFacetTest::initTestCase()
  123. // We create a dummy model with some simple test data in it
  124. const Soprano::Backend* backend = Soprano::PluginManager::instance()->discoverBackendByName( "virtuosobackend" );
  125. QVERIFY( backend );
  126. - m_storageDir = new KTempDir();
  127. - m_model = backend->createModel( Soprano::BackendSettings() << Soprano::BackendSetting(Soprano::BackendOptionStorageDir, m_storageDir->name()) );
  128. + m_storageDir = new QTemporaryDir();
  129. + QString storageDir = m_storageDir->path() + '/' ;
  130. +
  131. + m_model = backend->createModel( Soprano::BackendSettings() << Soprano::BackendSetting(Soprano::BackendOptionStorageDir, storageDir ) );
  132. QVERIFY( m_model );
  133.  
  134. Nepomuk::ResourceManager::instance()->setOverrideMainModel( m_model );
  135. diff --git a/nepomuk/test/dynamicresourcefacettest.h b/nepomuk/test/dynamicresourcefacettest.h
  136. index 33497e6..4ec9db2 100644
  137. --- a/nepomuk/test/dynamicresourcefacettest.h
  138. +++ b/nepomuk/test/dynamicresourcefacettest.h
  139. @@ -23,7 +23,8 @@
  140. #define DYNAMICRESOURCEFACETTEST_H
  141.  
  142. #include <QObject>
  143. -#include "ktempdir.h"
  144. +#include <qtemporarydir.h>
  145. +
  146. #include "tag.h"
  147. #include "dynamicresourcefacet.h"
  148.  
  149. @@ -60,7 +61,7 @@ private slots:
  150. void testSetClientQuery();
  151.  
  152. private:
  153. - KTempDir* m_storageDir;
  154. + QTemporaryDir* m_storageDir;
  155. Soprano::Model* m_model;
  156. Nepomuk::Tag tag1, tag2, tag3, tag4;
  157. };
  158. diff --git a/nepomuk/test/queryparsertest.cpp b/nepomuk/test/queryparsertest.cpp
  159. index 6c059cf..74d9372 100644
  160. --- a/nepomuk/test/queryparsertest.cpp
  161. +++ b/nepomuk/test/queryparsertest.cpp
  162. @@ -33,8 +33,7 @@
  163.  
  164. #include <QtTest>
  165. #include <qtest_kde.h>
  166. -
  167. -#include "ktempdir.h"
  168. +#include <qtemporarydir.h>
  169.  
  170. #include <Soprano/LiteralValue>
  171. #include <Soprano/Node>
  172. @@ -60,8 +59,10 @@ void QueryParserTest::initTestCase()
  173. // that are used by libnepomuk below
  174. const Soprano::Backend* backend = Soprano::PluginManager::instance()->discoverBackendByName( "virtuosobackend" );
  175. QVERIFY( backend );
  176. - m_storageDir = new KTempDir();
  177. - m_model = backend->createModel( Soprano::BackendSettings() << Soprano::BackendSetting(Soprano::BackendOptionStorageDir, m_storageDir->name()) );
  178. + m_storageDir = new QTemporaryDir();
  179. + QString storageDir = m_storageDir->path() + '/' ;
  180. +
  181. + m_model = backend->createModel( Soprano::BackendSettings() << Soprano::BackendSetting(Soprano::BackendOptionStorageDir, storageDir) );
  182. QVERIFY( m_model );
  183.  
  184. // we create one fake ontology
  185. diff --git a/nepomuk/test/queryparsertest.h b/nepomuk/test/queryparsertest.h
  186. index 920d856..75fe574 100644
  187. --- a/nepomuk/test/queryparsertest.h
  188. +++ b/nepomuk/test/queryparsertest.h
  189. @@ -23,7 +23,7 @@
  190. #define _NEPOMUK_QUERY_PARSER_TEST_H_
  191.  
  192. #include <QtCore/QObject>
  193. -#include "ktempdir.h"
  194. +#include <qtemporarydir.h>
  195.  
  196. #include <Soprano/Model>
  197.  
  198. @@ -42,7 +42,7 @@ private Q_SLOTS:
  199. void testQueryParserDetectFilenamePattern();
  200.  
  201. private:
  202. - KTempDir* m_storageDir;
  203. + QTemporaryDir* m_storageDir;
  204. Soprano::Model* m_model;
  205. };
  206.  
  207. diff --git a/nepomuk/test/testbase.cpp b/nepomuk/test/testbase.cpp
  208. index 8dbd012..7ad30cf 100644
  209. --- a/nepomuk/test/testbase.cpp
  210. +++ b/nepomuk/test/testbase.cpp
  211. @@ -19,16 +19,17 @@
  212.  
  213. #include <Soprano/Soprano>
  214.  
  215. -#include <ktempdir.h>
  216. +#include <qtemporarydir.h>
  217.  
  218. void TestBase::initTestCase()
  219. {
  220. - m_tmpDir = new KTempDir();
  221. + m_tmpDir = new QTemporaryDir();
  222. const Soprano::Backend* backend = Soprano::PluginManager::instance()->discoverBackendByName("virtuoso");
  223. if( !backend ) {
  224. QSKIP( "Unable to load Virtuoso backend, skipping test.", SkipAll );
  225. }
  226. - m_model = backend->createModel( Soprano::BackendSettings() << Soprano::BackendSetting(Soprano::BackendOptionStorageDir, m_tmpDir->name() ));
  227. + QString tmpDir = m_tmpDir->path() + '/' ;
  228. + m_model = backend->createModel( Soprano::BackendSettings() << Soprano::BackendSetting(Soprano::BackendOptionStorageDir, tmpDir ));
  229. Nepomuk::ResourceManager::instance()->setOverrideMainModel( m_model );
  230. }
  231.  
  232. diff --git a/nepomuk/test/testbase.h b/nepomuk/test/testbase.h
  233. index 471aa89..43777b1 100644
  234. --- a/nepomuk/test/testbase.h
  235. +++ b/nepomuk/test/testbase.h
  236. @@ -17,7 +17,8 @@
  237.  
  238. #include <QtTest/QtTest>
  239.  
  240. -class KTempDir;
  241. +
  242. +class QTemporaryDir;
  243. namespace Soprano {
  244. class Model;
  245. }
  246. @@ -33,7 +34,7 @@ private Q_SLOTS:
  247. virtual void cleanup();
  248.  
  249. private:
  250. - KTempDir* m_tmpDir;
  251. + QTemporaryDir* m_tmpDir;
  252. Soprano::Model* m_model;
  253. };
  254.  
  255. diff --git a/plasma/CMakeLists.txt b/plasma/CMakeLists.txt
  256. index bc4a225..5fef3b8 100644
  257. --- a/plasma/CMakeLists.txt
  258. +++ b/plasma/CMakeLists.txt
  259. @@ -32,6 +32,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
  260. ${CMAKE_SOURCE_DIR}/plasma/private/qtjolie-branch/qtjolie
  261. ${CMAKE_SOURCE_DIR}/plasma/private/qtjolie-branch
  262. ${CMAKE_SOURCE_DIR}/plasma/private/qtjolie-branch/includes
  263. + ${CMAKE_SOURCE_DIR}/libinqt5/src
  264. + ${CMAKE_BINARY_DIR}/libinqt5/src
  265. )
  266.  
  267. if(NOT PLASMA_NO_KIO)
  268. diff --git a/plasma/package.cpp b/plasma/package.cpp
  269. index ef29b5e..4123756 100644
  270. --- a/plasma/package.cpp
  271. +++ b/plasma/package.cpp
  272. @@ -28,6 +28,7 @@
  273. #include <QIODevice>
  274. #include <QRegExp>
  275. #include <QtNetwork/QHostInfo>
  276. +#include <qtemporarydir.h>
  277.  
  278. #include <karchive.h>
  279. #include <kdebug.h>
  280. @@ -36,7 +37,6 @@
  281. #include <kservicetypetrader.h>
  282. #include <kstandarddirs.h>
  283. #include <ktar.h>
  284. -#include <ktempdir.h>
  285. #include <kzip.h>
  286.  
  287. #include "config-plasma.h"
  288. @@ -289,9 +289,9 @@ KPluginInfo Package::metadata() const
  289.  
  290. if (archive && archive->open(QIODevice::ReadOnly)) {
  291. const KArchiveDirectory *source = archive->directory();
  292. - KTempDir tempdir;
  293. - source->copyTo(tempdir.name());
  294. - d->createPackageMetadata(tempdir.name());
  295. + QTemporaryDir tempdir;
  296. + source->copyTo(tempdir.path() + '/');
  297. + d->createPackageMetadata(tempdir.path() + '/');
  298. } else {
  299. kWarning() << "Could not open package file:" << d->path;
  300. }
  301. @@ -730,7 +730,7 @@ bool PackagePrivate::installPackage(const QString &package, const QString &packa
  302. }
  303.  
  304. QString path;
  305. - KTempDir tempdir;
  306. + QTemporaryDir tempdir;
  307. bool archivedPackage = false;
  308.  
  309. if (fileInfo.isDir()) {
  310. @@ -763,7 +763,7 @@ bool PackagePrivate::installPackage(const QString &package, const QString &packa
  311. }
  312.  
  313. archivedPackage = true;
  314. - path = tempdir.name();
  315. + path = tempdir.path() + '/';
  316.  
  317. const KArchiveDirectory *source = archive->directory();
  318. source->copyTo(path);
  319. diff --git a/plasma/remote/accessappletjob.cpp b/plasma/remote/accessappletjob.cpp
  320. index dbd4271..26da7f6 100644
  321. --- a/plasma/remote/accessappletjob.cpp
  322. +++ b/plasma/remote/accessappletjob.cpp
  323. @@ -20,11 +20,11 @@
  324. #include "accessappletjob.h"
  325.  
  326. #include <qtimer.h>
  327. +#include <qtemporarydir.h>
  328.  
  329. #include <kdebug.h>
  330. #include <kdesktopfile.h>
  331. #include <kmessagebox.h>
  332. -#include <ktempdir.h>
  333. #include <kzip.h>
  334.  
  335. #include "config-plasma.h"
  336. @@ -108,9 +108,9 @@ public:
  337.  
  338. const KArchiveDirectory *source = archive.directory();
  339.  
  340. - KTempDir tempDir;
  341. + QTemporaryDir tempDir;
  342. tempDir.setAutoRemove(false);
  343. - QString path = tempDir.name();
  344. + QString path = tempDir.path() + '/';
  345. source->copyTo(path);
  346.  
  347. KDesktopFile metadata(path + "/metadata.desktop");
Add Comment
Please, Sign In to add comment