konq-plugin/fsview: Fix sigfault in a unittest

This resolves Bug 1639
pull/1/head
Alexander Golubev 11 years ago committed by Slávek Banko
parent 6085d1a6e1
commit 03d162c5ad

@ -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",
printf("Change in %s: Dirs %d, Files %d, Size %llu\n",
d->name().latin1(),
d->dirCount(), d->fileCount());
printf("Size %llu\n", (unsigned long long int)d->size());
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());

Loading…
Cancel
Save