Exemple #1
0
ConfigIncludeDummy::ConfigIncludeDummy(FolderSelectionModel *pModel, FolderSelectionWidget *pParent)
   : QWidget(pParent), mModel(pModel), mTreeView(pParent)
{
	connect(mModel, SIGNAL(includedPathsChanged()), this, SIGNAL(includeListChanged()));
	KConfigDialogManager::changedMap()->insert(QStringLiteral("ConfigIncludeDummy"),
	                                           SIGNAL(includeListChanged()));
}
Exemple #2
0
/// For every includer file that is run across during parsing, this means that
/// the includer file was fully parsed, and that no old included information
/// needs to be kept, except to check if the old included information has not
/// changed.
///
///  This code assumes that no tricks are played with ifdef values, and
/// ifdef values must be the same every time a the same file is included.
void IncDirDependencyMap::write()
    {
    bool anyChanges = false;
    time_t curTime;
    time_t changedTime = 0;
    time(&curTime);

#if(SHARED_FILE)
    SharedFile file;
    if(!writeFileExclusiveReadUpdate(file))
        {
        fprintf(stderr, "\nOovCppParser - Write file sharing error %s\n", getFilename().c_str());
        }
#endif
    // Append new values from parsed includes into the original NameValueFile.
    // Update existing values times and make new dependencies.
    for(const auto &newMapItem : mParsedIncludeDependencies)
        {
        bool changed = includedPathsChanged(newMapItem.first, newMapItem.second);
        if(changed)
            {
            // Cheat and say updated time and checked time are the same.
            changedTime = curTime;

            CompoundValue newIncludedInfoCompVal;
            OovString changeStr;
            changeStr.appendInt(changedTime);
            newIncludedInfoCompVal.addArg(changeStr);

            OovString checkedStr;
            checkedStr.appendInt(curTime);
            newIncludedInfoCompVal.addArg(checkedStr);

            for(const auto &str : newMapItem.second)
                {
                size_t pos = newIncludedInfoCompVal.find(str);
                if(pos == CompoundValue::npos)
                    {
                    newIncludedInfoCompVal.addArg(str);
                    }
                }
            setNameValue(newMapItem.first, newIncludedInfoCompVal.getAsString());
            anyChanges = true;
            }
        }
    if(file.isOpen() && anyChanges)
        {
#if(SHARED_FILE)
        if(!writeFileExclusive(file))
            {
            OovString str = "Unable to write include map file";
            OovError::report(ET_Error, str);
            }
#else
        writeFile();
#endif
        }
    }
Exemple #3
0
void FolderSelectionModel::excludePath(const QString& pPath) {
	if(mExcludedFolderList.contains(pPath)) {
		return;
	}
	const InclusionState lState = inclusionState(pPath);
	removeSubDirs(pPath, mIncludedFolderList);
	removeSubDirs(pPath, mExcludedFolderList);
	if(lState == StateIncluded) {
		emit includedPathsChanged();
	} else if(lState == StateIncludeInherited) {
		mExcludedFolderList.insert(pPath);
		emit excludedPathsChanged();
	}
	emit dataChanged(index(pPath), findLastLeaf(index(pPath), this));
}