MCPcopy Create free account
hub / github.com/TeXworks/texworks / addPath

Method addPath

src/PrefsDialog.cpp:138–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void PrefsDialog::addPath()
139{
140 QString dir = QFileDialog::getExistingDirectory(this, tr("Choose Directory"),
141 QString::fromLatin1("/usr"), /*0*/ /*QFileDialog::DontUseNativeDialog*/
142 QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
143 // remove the trailing / (if any)
144 dir = QDir::fromNativeSeparators(dir);
145#if defined(Q_OS_WIN)
146 if (dir.length() > 2)
147#else
148 if (dir.length() > 1)
149#endif
150 if (dir.at(dir.length() - 1) == QChar::fromLatin1('/'))
151 dir.chop(1);
152 if (!dir.isEmpty()) {
153 binPathList->addItem(dir);
154 binPathList->setCurrentItem(binPathList->item(binPathList->count() - 1));
155 pathsChanged = true;
156 }
157}
158
159void PrefsDialog::removePath()
160{

Callers 2

setupFileWatcherMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected