~ubuntu-branches/ubuntu/quantal/kate/quantal-proposed

« back to all changes in this revision

Viewing changes to kate/plugins/externaltools/kateexternaltools.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-14 13:28:06 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: package-import@ubuntu.com-20111214132806-aa2uf6ri5w2p8ak3
Tags: upstream-4.7.90
ImportĀ upstreamĀ versionĀ 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include <KMessageBox>
37
37
#include <KMimeTypeChooser>
38
38
#include <KXmlGuiWindow>
 
39
#include <KStandardDirs>
39
40
#include <KConfig>
40
41
#include <KConfigGroup>
41
42
#include <KComboBox>
92
93
  // NOTE this code is modified taken from kdesktopfile.cpp, from KDesktopFile::tryExec()
93
94
  if (!tryexec.isEmpty())
94
95
  {
95
 
    if (tryexec[0] == '/')
96
 
    {
97
 
      if (KDE::access(tryexec, R_OK | X_OK))
98
 
        return false;
99
 
 
100
 
      m_exec = tryexec;
101
 
    }
102
 
    else
103
 
    {
104
 
      // !!! Sergey A. Sukiyazov <corwin@micom.don.ru> !!!
105
 
      // Environment PATH may contain filenames in 8bit locale cpecified
106
 
      // encoding (Like a filenames).
107
 
      const QString path = QFile::decodeName(qgetenv("PATH"));
108
 
      const QStringList dirs = path.split(KPATH_SEPARATOR, QString::SkipEmptyParts);
109
 
      QStringList::ConstIterator it(dirs.begin());
110
 
      bool match = false;
111
 
      for (; it != dirs.end(); ++it)
112
 
      {
113
 
        QString fName = *it + '/' + tryexec;
114
 
        if (KDE::access(fName, R_OK | X_OK) == 0)
115
 
        {
116
 
          match = true;
117
 
          m_exec = fName;
118
 
          break;
119
 
        }
120
 
      }
121
 
      // didn't match at all
122
 
      if (!match)
123
 
        return false;
124
 
    }
125
 
    return true;
 
96
    m_exec = KStandardDirs::findExe(tryexec);
 
97
    return !m_exec.isEmpty();
126
98
  }
127
99
  return false;
128
100
}
637
609
  btnMoveDown->setIcon(KIcon("go-down"));
638
610
 
639
611
  connect( lbTools, SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged()) );
640
 
  connect( lbTools, SIGNAL( itemDoubleClicked ( QListWidgetItem * ) ), this, SLOT( slotEdit() ) );
 
612
  connect( lbTools, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(slotEdit()) );
641
613
  connect( btnNew, SIGNAL(clicked()), this, SLOT(slotNew()) );
642
614
  connect( btnRemove, SIGNAL(clicked()), this, SLOT(slotRemove()) );
643
615
  connect( btnEdit, SIGNAL(clicked()), this, SLOT(slotEdit()) );