| 136 | } |
| 137 | |
| 138 | void 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 | |
| 159 | void PrefsDialog::removePath() |
| 160 | { |
no outgoing calls
no test coverage detected