Commit 1fa8bcc7 authored by Peter Simonsson's avatar Peter Simonsson

Make recent files work again

svn path=/trunk/koffice/; revision=663957
parent bb0a0503
......@@ -311,7 +311,7 @@ KoMainWindow::KoMainWindow( const KComponentData &componentData )
// Load list of recent files
KSharedConfigPtr config = componentData.isValid() ? componentData.config() : KGlobal::config();
m_recent->loadEntries( config->group( QString() ) );
m_recent->loadEntries( config->group( "RecentFiles" ) );
createShellGUI();
d->bMainWindowGUIBuilt = true;
......@@ -512,7 +512,7 @@ void KoMainWindow::saveRecentFiles()
// Save list of recent files
KSharedConfigPtr config = componentData().isValid() ? componentData().config() : KGlobal::config();
kDebug(30003) << this << " Saving recent files list into config. componentData()=" << componentData().componentName() << endl;
m_recent->saveEntries( config->group( QString() ) );
m_recent->saveEntries( config->group( "RecentFiles" ) );
config->sync();
// Tell all windows to reload their list, after saving
......
......@@ -101,25 +101,16 @@ KoRecentDocumentsPane::KoRecentDocumentsPane(QWidget* parent, const KComponentDa
KConfigGroup config( componentData().config(), "RecentFiles" );
int i = 0;
int i = 1;
QString value;
QList<KFileItem> fileList;
QStandardItem* rootItem = model()->invisibleRootItem();
do {
const QString key = QString("File%1").arg(i);
value = config.readPathEntry(key);
if(!value.isEmpty()) {
QString path = value;
QString name;
// Support for kdelibs-3.5's new RecentFiles format: name[url]
if(path.endsWith("]")) {
int pos = path.indexOf("[");
name = path.mid(0, pos - 1);
path = path.mid(pos + 1, path.length() - pos - 2);
}
QString path = config.readPathEntry(QString("File%1").arg(i));
if(!path.isEmpty()) {
QString name = config.readPathEntry(QString("Name%1").arg(i));
KUrl url(path);
......
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