@@ -64,23 +64,23 @@ void Verby::getLabels(QList<launchy::InputData>* inputData) {
64
64
// If it's not an item from Launchy's built in catalog,
65
65
// i.e. a file or directory or something added
66
66
// by a plugin, don't add verbs.
67
- if (inputData->first ().getPlugin () != " Verby " ) {
67
+ if (! inputData->first ().getPlugin (). isEmpty () ) {
68
68
return ;
69
69
}
70
70
71
71
QString path = inputData->first ().getTopResult ().fullPath ;
72
72
QFileInfo info (path);
73
73
if (info.isSymLink ()) {
74
- inputData->first ().setLabel (HASH_LINK );
74
+ inputData->first ().setLabel (LABEL_LINK );
75
75
}
76
76
else if (info.isDir ()) {
77
- inputData->first ().setLabel (HASH_DIR );
77
+ inputData->first ().setLabel (LABEL_DIR );
78
78
}
79
79
else if (info.isExecutable ()) {
80
- inputData->first ().setLabel (HASH_EXEC );
80
+ inputData->first ().setLabel (LABEL_EXEC );
81
81
}
82
82
else if (info.isFile ()) {
83
- inputData->first ().setLabel (HASH_FILE );
83
+ inputData->first ().setLabel (LABEL_FILE );
84
84
}
85
85
}
86
86
@@ -89,7 +89,7 @@ const QString& Verby::getIconPath() const {
89
89
}
90
90
91
91
bool Verby::isMatch (const QString& text1, const QString& text2) {
92
- int text2Length = text2.count ();
92
+ int text2Length = text2.length ();
93
93
int curChar = 0 ;
94
94
foreach (QChar c, text1) {
95
95
if (c.toLower () == text2[curChar].toLower ()) {
@@ -123,21 +123,21 @@ void Verby::getResults(QList<InputData>* inputData, QList<CatItem>* results) {
123
123
}
124
124
QString text = inputData->at (1 ).getText ();
125
125
126
- if (inputData->first ().hasLabel (HASH_DIR )) {
126
+ if (inputData->first ().hasLabel (LABEL_DIR )) {
127
127
addCatItem (text, results, " Properties" , " Directory properties" , " verby_properties.png" );
128
128
}
129
- else if (inputData->first ().hasLabel (HASH_EXEC )) {
129
+ else if (inputData->first ().hasLabel (LABEL_EXEC )) {
130
130
addCatItem (text, results, " Run as" , " Run as admin" , " verby_run.png" );
131
131
addCatItem (text, results, " Open containing folder" , " Open containing folder" , " verby_opencontainer.png" );
132
132
addCatItem (text, results, " Copy path" , " Copy path to clipboard" , " verby_copy.png" );
133
133
addCatItem (text, results, " Properties" , " File properties" , " verby_properties.png" );
134
134
}
135
- else if (inputData->first ().hasLabel (HASH_FILE )) {
135
+ else if (inputData->first ().hasLabel (LABEL_FILE )) {
136
136
addCatItem (text, results, " Open containing folder" , " Open containing folder" , " verby_opencontainer.png" );
137
137
addCatItem (text, results, " Copy path" , " Copy path to clipboard" , " verby_copy.png" );
138
138
addCatItem (text, results, " Properties" , " File properties" , " verby_properties.png" );
139
139
}
140
- else if (inputData->first ().hasLabel (HASH_LINK )) {
140
+ else if (inputData->first ().hasLabel (LABEL_LINK )) {
141
141
addCatItem (text, results, " Run as" , " Run as admin" , " verby_run.png" );
142
142
addCatItem (text, results, " Open containing folder" , " Open containing folder" , " verby_opencontainer.png" );
143
143
addCatItem (text, results, " Open shortcut folder" , " Open shortcut folder" , " verby_opencontainer.png" );
@@ -157,7 +157,6 @@ void Verby::getResults(QList<InputData>* inputData, QList<CatItem>* results) {
157
157
inputData->last ().getText (),
158
158
m_pluginName,
159
159
m_libPath + " /verby_run.png" ));
160
-
161
160
}
162
161
163
162
int Verby::launchItem (QList<InputData>* inputData, CatItem* item) {
@@ -252,7 +251,6 @@ int Verby::launchItem(QList<InputData>* inputData, CatItem* item) {
252
251
return true ;
253
252
}
254
253
255
-
256
254
void Verby::doDialog (QWidget* parent, QWidget** newDlg) {
257
255
if (m_gui == nullptr ) {
258
256
qDebug () << " Verby::doDialog, create gui" ;
@@ -261,7 +259,6 @@ void Verby::doDialog(QWidget* parent, QWidget** newDlg) {
261
259
}
262
260
}
263
261
264
-
265
262
void Verby::endDialog (bool accept) {
266
263
if (accept && m_gui) {
267
264
m_gui->writeOptions ();
@@ -278,11 +275,10 @@ void Verby::endDialog(bool accept) {
278
275
Verby::Verby ()
279
276
: m_gui(nullptr ),
280
277
m_pluginName(" Verby" ),
281
- HASH_VERBY(" verby" ),
282
- HASH_DIR(" verby_directory" ),
283
- HASH_FILE(" verby_file" ),
284
- HASH_LINK(" verby_link" ),
285
- HASH_EXEC(" verby_exec" ) {
278
+ LABEL_DIR(" verby_directory" ),
279
+ LABEL_FILE(" verby_file" ),
280
+ LABEL_LINK(" verby_link" ),
281
+ LABEL_EXEC(" verby_exec" ) {
286
282
}
287
283
288
284
Verby::~Verby () {
0 commit comments