work save
This commit is contained in:
parent
98db43420c
commit
515a5a71fa
|
@ -670,6 +670,51 @@ int Project::getUnitFromString(const QString &s)
|
|||
return indexInUnits(s);
|
||||
}
|
||||
|
||||
void Project::incrementBuildNumber()
|
||||
{
|
||||
mOptions.versionInfo.build++;
|
||||
mOptions.versionInfo.fileVersion = QString("%1.%2.%3.%3")
|
||||
.arg(mOptions.versionInfo.major)
|
||||
.arg(mOptions.versionInfo.minor)
|
||||
.arg(mOptions.versionInfo.release)
|
||||
.arg(mOptions.versionInfo.build);
|
||||
if (mOptions.versionInfo.syncProduct)
|
||||
mOptions.versionInfo.productVersion = mOptions.versionInfo.fileVersion;
|
||||
setModified(true);
|
||||
}
|
||||
|
||||
QString Project::listUnitStr(const QChar &separator)
|
||||
{
|
||||
QStringList units;
|
||||
foreach (const PProjectUnit& unit, mUnits) {
|
||||
units.append('"'+unit->fileName()+'"');
|
||||
}
|
||||
return units.join(separator);
|
||||
}
|
||||
|
||||
void Project::loadLayout()
|
||||
{
|
||||
QSettings layIni = QSettings(changeFileExt(filename(), "layout"),QSettings::IniFormat);
|
||||
layIni.beginGroup("Editors");
|
||||
int topLeft = layIni.value("Focused", -1).toInt();
|
||||
//TopRight := layIni.ReadInteger('Editors', 'FocusedRight', -1);
|
||||
QString temp =layIni.value("Order", "").toString();
|
||||
layIni.endGroup();
|
||||
QStringList sl = temp.split(",");
|
||||
|
||||
foreach (const QString& s,sl) {
|
||||
bool ok;
|
||||
int currIdx = s.toInt(&ok);
|
||||
if (ok) {
|
||||
openUnit(currIdx);
|
||||
}
|
||||
}
|
||||
if (topLeft>=0 && topLeft<mUnits.count() && mUnits[topLeft]->editor()) {
|
||||
mUnits[topLeft]->editor()->activate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PCppParser Project::cppParser()
|
||||
{
|
||||
return mParser;
|
||||
|
@ -700,6 +745,16 @@ int Project::indexInUnits(const Editor *editor) const
|
|||
return indexInUnits(editor->filename());
|
||||
}
|
||||
|
||||
std::shared_ptr<QSettings> &Project::iniFile()
|
||||
{
|
||||
return mIniFile;
|
||||
}
|
||||
|
||||
void Project::setIniFile(const std::shared_ptr<QSettings> &newIniFile)
|
||||
{
|
||||
mIniFile = newIniFile;
|
||||
}
|
||||
|
||||
const QString &Project::filename() const
|
||||
{
|
||||
return mFilename;
|
||||
|
|
|
@ -163,6 +163,9 @@ public:
|
|||
QChar getCompilerOption(const QString& optionString);
|
||||
QString getFolderPath(PFolderNode node);
|
||||
int getUnitFromString(const QString& s);
|
||||
void incrementBuildNumber();
|
||||
QString listUnitStr(const QChar& separator);
|
||||
void loadLayout(); // load all [UnitX]
|
||||
|
||||
int newUnit(bool newProject,
|
||||
PFolderNode parentNode,
|
||||
|
@ -171,7 +174,6 @@ public:
|
|||
Editor* openUnit(int index);
|
||||
void saveUnitAs(int i, const QString& sFileName); // save single [UnitX]
|
||||
void saveAll(); // save [Project] and all [UnitX]
|
||||
void loadLayout(); // load all [UnitX]
|
||||
void loadUnitLayout(Editor *e, int index); // load single [UnitX] cursor positions
|
||||
void saveLayout(); // save all [UnitX]
|
||||
void saveUnitLayout(Editor* e, int index); // save single [UnitX] cursor positions
|
||||
|
@ -184,19 +186,20 @@ public:
|
|||
bool removeFolder(PFolderNode node);
|
||||
bool removeEditor(int index, bool doClose);
|
||||
void rebuildNodes();
|
||||
QString listUnitStr(const QChar& separator);
|
||||
|
||||
void showOptions();
|
||||
// bool assignTemplate(const QString& aFileName, const PTemplate& aTemplate);
|
||||
void updateNodeIndexes();
|
||||
void setNodeValue(PFolderNode value);
|
||||
void incrementBuildNumber();
|
||||
void setCompilerOption(const QString& optionString, const QChar& value);
|
||||
void saveToLog();
|
||||
|
||||
std::shared_ptr<CppParser> cppParser();
|
||||
const QString &filename() const;
|
||||
|
||||
std::shared_ptr<QSettings> &iniFile();
|
||||
void setIniFile(const std::shared_ptr<QSettings> &newIniFile);
|
||||
|
||||
signals:
|
||||
void nodesChanged();
|
||||
void modifyChanged(bool value);
|
||||
|
|
Loading…
Reference in New Issue