コード例 #1
0
void CdbSymbolPathListEditor::setupSymbolPaths()
{
    const QStringList &currentPaths = pathList();
    const int indexOfSymbolServer = indexOfSymbolPath(currentPaths, SymbolServerPath);
    const int indexOfSymbolCache = indexOfSymbolPath(currentPaths, SymbolCachePath);

    QString path;
    if (indexOfSymbolServer != -1)
        path = currentPaths.at(indexOfSymbolServer);
    if (path.isEmpty() && indexOfSymbolCache != -1)
        path = currentPaths.at(indexOfSymbolCache);
    if (path.isEmpty())
        path = Utils::TemporaryDirectory::masterDirectoryPath() + "/symbolcache";

    bool useSymbolServer = true;
    bool useSymbolCache = true;
    bool addSymbolPaths = SymbolPathsDialog::useCommonSymbolPaths(useSymbolCache,
                                                                  useSymbolServer,
                                                                  path);
    if (!addSymbolPaths)
        return;

    if (useSymbolCache) {
        insertPathAtCursor(CdbSymbolPathListEditor::symbolPath(path, SymbolCachePath));
        if (useSymbolServer)
            insertPathAtCursor(CdbSymbolPathListEditor::symbolPath(QString(), SymbolServerPath));
    } else if (useSymbolServer) {
        insertPathAtCursor(CdbSymbolPathListEditor::symbolPath(path, SymbolServerPath));
    }
}
コード例 #2
0
void CdbSymbolPathListEditor::addSymbolServer()
{
    const QString cacheDir = promptCacheDirectory(this);
    if (!cacheDir.isEmpty())
        insertPathAtCursor(CdbSymbolPathListEditor::symbolServerPath(cacheDir));
}
コード例 #3
0
void CdbSymbolPathListEditor::addSymbolPath(CdbSymbolPathListEditor::SymbolPathMode mode)
{
    QString cacheDir;
    if (promptCacheDirectory(this, &cacheDir))
        insertPathAtCursor(CdbSymbolPathListEditor::symbolPath(cacheDir, mode));
}
コード例 #4
0
void PathListEditor::slotInsert()
{
    const QString dir = QFileDialog::getExistingDirectory(this, d->fileDialogTitle);
    if (!dir.isEmpty())
        insertPathAtCursor(QDir::toNativeSeparators(dir));
}