Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * =====================================================================================
- * Filename: qgui.h
- *
- * Version: 1.0
- * Created: 23/04/12 15:42:19
- * Compiler: "make" from QScanner root. Requires qt make installed
- * $ sudo apt-get install libqt4-dev
- *
- * Author: Oliver Fletcher, ttolf@lboro.ac.uk
- * University: Loughborough University
- * =====================================================================================
- */
- #ifndef QGUI_H
- #define QGUI_H
- #include "ui_qgui.h"
- #include <stdlib.h>
- #include <QFuture>
- #include <QFutureWatcher>
- #include "k.h"
- #include <string>
- class qguiApp : public QWidget, private Ui::qgui
- {
- Q_OBJECT
- private:
- QFutureWatcher<void> *watcher;
- QFutureWatcher<void> *updateWatcher;
- QFutureWatcher<void> *fileWatcher;
- QFuture<QByteArray> *future;
- QFuture<QByteArray> *updateFuture;
- QFuture<QByteArray> *fileFuture;
- bool isdir;
- std::string fname;
- std::string dir;
- public:
- qguiApp(QWidget *parent=0);
- ~qguiApp(){
- }
- public slots:
- void getPathOrDir();
- void getPath();
- void scanTypeChanged();
- void run_thread();
- void scan();
- void display_logs();
- void file_thread();
- void file_logs();
- void clearScan();
- void clearFile();
- void updateSettings();
- void showSave();
- void loadSettings();
- void update_thread();
- void update_start();
- void update_logs();
- void showHelp();
- };
- class qconn
- {
- private:
- int c;
- public:
- qconn(){
- c=khp("localhost",5000);
- }
- ~qconn(){
- kclose(c);
- }
- K sync_query(char *qinput){
- K result;
- result = k(c,qinput,(K)0);
- return result;
- }
- void async_query(char *qinput){
- k(-c,qinput,(K)0);
- }
- bool isConnected(){
- if(c < 0){
- return false;
- }
- else return true;
- }
- };
- QByteArray q_query(char* qinput,bool isdir);
- QByteArray file_query(char* qinput);
- QByteArray update_query();
- void launchDaemon();
- void qScannerPath();
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement