-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearchUI.h
More file actions
115 lines (90 loc) · 2.29 KB
/
searchUI.h
File metadata and controls
115 lines (90 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#ifndef _SEARCHUI_H_
#define _SEARCHUI_H_
#define QT_THREAD_SUPPORT
#include <ZPopup.h>
#include <ZMeter.h>
#include <ZSoftKey.h>
#include <ZLabel.h>
#include <ZListBox.h>
#include <qthread.h>
#include <qtimer.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qdir.h>
#include <qscrollview.h>
#include <stdio.h>
#include <iostream>
#include "myDef.h"
#if defined(E8) || defined(EM30) || defined(VE66)
#include <ZMeterModule.h>
#endif
class searchThread : public QThread
{
public :
searchThread(const QString &path, const QString &key, bool isSearchFile = false, int limitFolderDepth = 5);
~searchThread();
bool isFinish();
QString getCurPath();
QStringList getResultList();
void stopSearch();
protected :
void searchFile( const QString &path);
virtual void run();
int getFolderDepth( const QString &path);
bool fileSearched(const QString &file);
bool isTextFile(const QString &file);
private :
int m_nFolderDepth;
int m_nCurFolderDepth;
int m_nParentFolderDepthNum;
bool m_bFinishState;
bool m_bSearchStopState;
bool m_bFileSearchState;
QString m_strPath;
QString m_strKey;
QString m_strCurPath;
QStringList m_lsResultList;
};
class searchDlg : public ZPopup
{
Q_OBJECT
public :
searchDlg( const QString &path, const QString &key , bool isSearchFile = false);
~searchDlg();
QStringList getResultList();
private slots:
void slotTimerEvent();
void slotQuit();
void slotHide();
private:
searchThread *m_thread;
QTimer *timer;
ZMeterModule *m_zMeterModule;
ZMeter *m_zMeter;
int m_nStep;
bool m_bFileSearchState;
QString m_strPath;
QString m_strKey;
QStringList m_lsResultList;
};
class searchUI :public ZPopup
{
Q_OBJECT
public:
searchUI(const QStringList &itemList);
~searchUI();
QString getClickedObjName(); // /ezxlocal/download/test.sh >> return test.sh
QString getClickedObjDirname(); // /ezxlocal/download/test.sh >> return /ezxlocal/download
// /ezxlocal/download >> return /ezxlocal/download
bool isClickedDir();
public slots:
void obj_selected(int);
void showItemList();
private:
ZListBox *m_zListBox;
ZSoftKey *softKey;
bool m_bClickDirState;
QString m_strClickedFile;
QStringList m_lsItemList;
};
#endif