view DataController.hpp @ 0:a3834af36579

Working with memory backend.
author Tom Fredrik Blenning Klaussen <bfg@blenning.no>
date Mon, 20 Aug 2012 15:49:48 +0200
parents
children aae83c0a771d
line wrap: on
line source

#ifndef DATACONTROLLER_HPP
#define DATACONTROLLER_HPP

#include <QtCore/QObject>

#include "FileDbLink.hpp"

class QMainWindow;
class QTreeWidget;
class QTreeWidgetItem;
class QAction;
class QSpinBox;
class QTimer;

class DataController : QObject {
private:
  Q_OBJECT

  public:
  DataController();
  ~DataController();

public slots:
  //void cellClicked(int row, int column);
  void cellDoubleClicked(int row, int column);
  bool toggleShowFullPath();
  void setShowFullPath(bool);
  void populate();
  void delayPopulate();


signals:
  void populateProgress(int);

private:
  void populate(bool showNameDups, bool showSizeDups,
		bool showMTimeDups, bool showCheckSumDups,
		float editDistanceCutoff);

  QTreeWidgetItem* createItem(const FileDbLink::DBInfo& info);

  bool showFullPath;
  QMainWindow* mw;
  QTreeWidget* tw;

  FileDbLink* dblink;

  QAction* nameFilter;
  QAction* sizeFilter;
  QAction* mtimeFilter;
  QAction* checksumFilter;
  QSpinBox* editCutoffSpin;

  QTimer* populateDelay;
};

#endif //DATACONTROLLER_HPP