@@ -64,23 +64,23 @@ void Verby::getLabels(QList<launchy::InputData>* inputData) {
6464 // If it's not an item from Launchy's built in catalog,
6565 // i.e. a file or directory or something added
6666 // by a plugin, don't add verbs.
67- if (inputData->first ().getPlugin () != " Verby " ) {
67+ if (! inputData->first ().getPlugin (). isEmpty () ) {
6868 return ;
6969 }
7070
7171 QString path = inputData->first ().getTopResult ().fullPath ;
7272 QFileInfo info (path);
7373 if (info.isSymLink ()) {
74- inputData->first ().setLabel (HASH_LINK );
74+ inputData->first ().setLabel (LABEL_LINK );
7575 }
7676 else if (info.isDir ()) {
77- inputData->first ().setLabel (HASH_DIR );
77+ inputData->first ().setLabel (LABEL_DIR );
7878 }
7979 else if (info.isExecutable ()) {
80- inputData->first ().setLabel (HASH_EXEC );
80+ inputData->first ().setLabel (LABEL_EXEC );
8181 }
8282 else if (info.isFile ()) {
83- inputData->first ().setLabel (HASH_FILE );
83+ inputData->first ().setLabel (LABEL_FILE );
8484 }
8585}
8686
@@ -89,7 +89,7 @@ const QString& Verby::getIconPath() const {
8989}
9090
9191bool Verby::isMatch (const QString& text1, const QString& text2) {
92- int text2Length = text2.count ();
92+ int text2Length = text2.length ();
9393 int curChar = 0 ;
9494 foreach (QChar c, text1) {
9595 if (c.toLower () == text2[curChar].toLower ()) {
@@ -123,21 +123,21 @@ void Verby::getResults(QList<InputData>* inputData, QList<CatItem>* results) {
123123 }
124124 QString text = inputData->at (1 ).getText ();
125125
126- if (inputData->first ().hasLabel (HASH_DIR )) {
126+ if (inputData->first ().hasLabel (LABEL_DIR )) {
127127 addCatItem (text, results, " Properties" , " Directory properties" , " verby_properties.png" );
128128 }
129- else if (inputData->first ().hasLabel (HASH_EXEC )) {
129+ else if (inputData->first ().hasLabel (LABEL_EXEC )) {
130130 addCatItem (text, results, " Run as" , " Run as admin" , " verby_run.png" );
131131 addCatItem (text, results, " Open containing folder" , " Open containing folder" , " verby_opencontainer.png" );
132132 addCatItem (text, results, " Copy path" , " Copy path to clipboard" , " verby_copy.png" );
133133 addCatItem (text, results, " Properties" , " File properties" , " verby_properties.png" );
134134 }
135- else if (inputData->first ().hasLabel (HASH_FILE )) {
135+ else if (inputData->first ().hasLabel (LABEL_FILE )) {
136136 addCatItem (text, results, " Open containing folder" , " Open containing folder" , " verby_opencontainer.png" );
137137 addCatItem (text, results, " Copy path" , " Copy path to clipboard" , " verby_copy.png" );
138138 addCatItem (text, results, " Properties" , " File properties" , " verby_properties.png" );
139139 }
140- else if (inputData->first ().hasLabel (HASH_LINK )) {
140+ else if (inputData->first ().hasLabel (LABEL_LINK )) {
141141 addCatItem (text, results, " Run as" , " Run as admin" , " verby_run.png" );
142142 addCatItem (text, results, " Open containing folder" , " Open containing folder" , " verby_opencontainer.png" );
143143 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) {
157157 inputData->last ().getText (),
158158 m_pluginName,
159159 m_libPath + " /verby_run.png" ));
160-
161160}
162161
163162int Verby::launchItem (QList<InputData>* inputData, CatItem* item) {
@@ -252,7 +251,6 @@ int Verby::launchItem(QList<InputData>* inputData, CatItem* item) {
252251 return true ;
253252}
254253
255-
256254void Verby::doDialog (QWidget* parent, QWidget** newDlg) {
257255 if (m_gui == nullptr ) {
258256 qDebug () << " Verby::doDialog, create gui" ;
@@ -261,7 +259,6 @@ void Verby::doDialog(QWidget* parent, QWidget** newDlg) {
261259 }
262260}
263261
264-
265262void Verby::endDialog (bool accept) {
266263 if (accept && m_gui) {
267264 m_gui->writeOptions ();
@@ -278,11 +275,10 @@ void Verby::endDialog(bool accept) {
278275Verby::Verby ()
279276 : m_gui(nullptr ),
280277 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" ) {
286282}
287283
288284Verby::~Verby () {
0 commit comments