Commit d61b37c0 authored by Simon Depiets's avatar Simon Depiets
Browse files

Fix an issue with the Recent Projects list

parent 8cbf0510
......@@ -358,7 +358,6 @@ QString Catalog::setPhase(const DocPosition& pos, const QString& phase)
void Catalog::setActivePhase(const QString& phase, ProjectLocal::PersonRole role)
{
//qCDebug(LOKALIZE_LOG)<<"setting active phase"<<phase<<role;
d._phase = phase;
d._phaseRole = role;
updateApprovedEmptyIndexCache();
......
......@@ -183,7 +183,6 @@ void GlossarySortFilterProxyModel::fetchMore(const QModelIndex&)
int expectedCount = rowCount() + FETCH_SIZE / 2;
while (rowCount(QModelIndex()) < expectedCount && sourceModel()->canFetchMore(QModelIndex())) {
sourceModel()->fetchMore(QModelIndex());
//qCDebug(LOKALIZE_LOG)<<"filter:"<<rowCount(QModelIndex())<<"/"<<sourceModel()->rowCount();
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers);
}
}
......@@ -369,7 +368,6 @@ static void getElementsForTermLangIndex(QDomElement termEntry, QString& lang, in
QString minusLang = lang; minusLang.replace('_', '-');
QStringRef soleLang = lang.leftRef(2);
//qCDebug(LOKALIZE_LOG)<<"started walking over"<<lang<<index;
QDomElement n = termEntry.firstChildElement(langSet);
QDomDocument document = n.ownerDocument();
int i = 0;
......@@ -380,7 +378,6 @@ static void getElementsForTermLangIndex(QDomElement termEntry, QString& lang, in
ourLangSetElement = n;
QDomElement ntigElem = n.firstChildElement(ntig);
while (!ntigElem.isNull()) {
//qCDebug(LOKALIZE_LOG)<<i<<ntigElem.firstChildElement(termGrp).firstChildElement(term).text();
if (i == index) {
tigElement = ntigElem;
termElement = ntigElem.firstChildElement(termGrp).firstChildElement(term);
......
......@@ -185,7 +185,6 @@ bool SubjectFieldModel::insertRows(int row, int count, const QModelIndex& parent
bool SubjectFieldModel::setData(const QModelIndex& index, const QVariant& value, int role)
{
qCDebug(LOKALIZE_LOG) << role;
QStringList& subjectFields = Project::instance()->glossary()->subjectFields;
subjectFields[index.row()] = value.toString();
return true;
......@@ -431,12 +430,10 @@ void GlossaryWindow::selectEntry(const QByteArray& id)
if (items.count()) {
m_browser->setCurrentIndex(items.first());
m_browser->scrollTo(items.first(), QAbstractItemView::PositionAtCenter);
//qCDebug(LOKALIZE_LOG)<<id<<items<<items.first().row();
} else {
//the row is probably not fetched yet
m_browser->setCurrentIndex(QModelIndex());
showEntryInEditor(id);
//qCDebug(LOKALIZE_LOG)<<id<<0;
}
}
......
......@@ -672,16 +672,13 @@ void LokalizeMainWindow::saveProjectState(KConfigGroup& stateGroup)
if (!nameSpecifier.isEmpty()) nameSpecifier.prepend('-');
KConfig* c = stateGroup.isValid() ? stateGroup.config() : &config;
m_openRecentFileAction->saveEntries(KConfigGroup(c, "RecentFiles" + nameSpecifier));
m_openRecentProjectAction->saveEntries(KConfigGroup(&config, "RecentProjects"));
}
void LokalizeMainWindow::readProperties(const KConfigGroup& stateGroup)
{
KConfig config;
const KConfig* c = stateGroup.isValid() ? stateGroup.config() : &config;
m_openRecentProjectAction->loadEntries(KConfigGroup(c, "RecentProjects"));
m_openRecentProjectAction->loadEntries(KConfigGroup(&config, "RecentProjects"));
QString path = stateGroup.readEntry("Project", QString());
if (Project::instance()->isLoaded() || path.isEmpty()) {
//1. we weren't existing yet when the signal was emitted
......@@ -694,8 +691,9 @@ void LokalizeMainWindow::readProperties(const KConfigGroup& stateGroup)
void LokalizeMainWindow::projectLoaded()
{
QString projectPath = Project::instance()->path();
qCDebug(LOKALIZE_LOG) << projectPath;
m_openRecentProjectAction->addUrl(QUrl::fromLocalFile(projectPath));
qCDebug(LOKALIZE_LOG) << "Loaded project : " << projectPath;
if (!projectPath.isEmpty())
m_openRecentProjectAction->addUrl(QUrl::fromLocalFile(projectPath));
KConfig config;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment