diff options
author | Alexander Golubev <fatzer2@gmail.com> | 2013-08-20 18:47:07 +0400 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-09-10 03:17:17 +0200 |
commit | 03d162c5adcfb6486cd0b2813449fa86d5ec083d (patch) | |
tree | 71e1f4c1022fd903482d8516ba73be0c5e7d7a86 /konq-plugins/fsview/scantest.cpp | |
parent | 6085d1a6e1cccacd3af4aaab64ea48a731d5143f (diff) | |
download | tdeaddons-03d162c5adcfb6486cd0b2813449fa86d5ec083d.tar.gz tdeaddons-03d162c5adcfb6486cd0b2813449fa86d5ec083d.zip |
konq-plugin/fsview: Fix sigfault in a unittest
This resolves Bug 1639
Diffstat (limited to 'konq-plugins/fsview/scantest.cpp')
-rw-r--r-- | konq-plugins/fsview/scantest.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/konq-plugins/fsview/scantest.cpp b/konq-plugins/fsview/scantest.cpp index e1319a9..daa7148 100644 --- a/konq-plugins/fsview/scantest.cpp +++ b/konq-plugins/fsview/scantest.cpp @@ -20,9 +20,14 @@ #include <stdio.h> #include <unistd.h> +#include <tdeapplication.h> #include "scan.h" +#ifndef FSVIEW_SCANTEST_DIRECTORY +#define FSVIEW_SCANTEST_DIRECTORY "/opt" +#endif // FSVIEW_SCANTEST_DIRECTORY + class MyListener: public ScanListener { public: @@ -33,10 +38,10 @@ public: void sizeChanged(ScanDir* d) { - printf("Change in %s: Dirs %d, Files %d", - d->name().latin1(), - d->dirCount(), d->fileCount()); - printf("Size %llu\n", (unsigned long long int)d->size()); + printf("Change in %s: Dirs %d, Files %d, Size %llu\n", + d->name().latin1(), + d->dirCount(), d->fileCount(), + (unsigned long long int)d->size() ); } void scanFinished(ScanDir* d) @@ -47,7 +52,9 @@ public: int main(int argc, char* argv[]) { - ScanManager m("/opt"); + TDEApplication app(argc, argv, "scantest", false, false, false); + + ScanManager m(FSVIEW_SCANTEST_DIRECTORY); if (argc>1) m.setTop(argv[1]); m.setListener(new MyListener()); |