Esempio n. 1
0
Project::Project(const Utils::FileName &fileName) :
    ProjectExplorer::Project(Constants::MimeType, fileName, [this] { scheduleProjectScan(); })
{
    setId(Constants::ProjectId);
    m_projectDir = QDir(fileName.parentDir().toString());
    readProjectSettings(fileName);

    m_projectScanTimer.setSingleShot(true);
    connect(&m_projectScanTimer, &QTimer::timeout, this, [this] { refresh(); });

    connect(&m_fsWatcher, &QFileSystemWatcher::directoryChanged, this, &Project::scheduleProjectScan);

    setDisplayName(m_projectDir.dirName());
}
Esempio n. 2
0
bool FlatModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
    if (!index.isValid())
        return false;
    if (role != Qt::EditRole)
        return false;

    Node *node = nodeForIndex(index);

    Utils::FileName orgFilePath = node->filePath();
    Utils::FileName newFilePath = orgFilePath.parentDir().appendPath(value.toString());

    ProjectExplorerPlugin::renameFile(node, newFilePath.toString());
    emit renamed(orgFilePath, newFilePath);
    return true;
}
void TargetSetupPage::setupWidgets()
{
    // Known profiles:
    QList<Kit *> kitList;
    if (m_requiredMatcher.isValid())
        kitList = KitManager::matchingKits(m_requiredMatcher);
    else
        kitList = KitManager::kits();


    foreach (Kit *k, kitList)
        addWidget(k);

    // Setup import widget:
    Utils::FileName path = Utils::FileName::fromString(m_projectPath);
    path = path.parentDir(); // base dir
    path = path.parentDir(); // parent dir
    m_importWidget->setCurrentDirectory(path);

    updateVisibility();
}