|
|
|
@ -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());
|
|
|
|
|