Add support for reading the profiles' menu index (favorites) from the profile file.

This patch doesn't write the index, only reads.

CCBUG: 18530

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=959584
This commit is contained in:
Kurt Hindenburg
2009-04-26 15:40:18 +00:00
parent f861001494
commit bc9d65ec79
5 changed files with 109 additions and 14 deletions

View File

@@ -80,6 +80,7 @@ const Profile::PropertyInfo Profile::DefaultPropertyNames[] =
, { TabBarPosition , "TabBarPosition" , GENERAL_GROUP , QVariant::Int }
, { StartInCurrentSessionDir , "StartInCurrentSessionDir" , GENERAL_GROUP , QVariant::Bool }
, { ShowNewAndCloseTabButtons, "ShowNewAndCloseTabButtons" , GENERAL_GROUP , QVariant::Bool }
, { MenuIndex, "MenuIndex" , GENERAL_GROUP , QVariant::String }
// Appearance
, { Font , "Font" , APPEARANCE_GROUP , QVariant::Font }
@@ -155,6 +156,7 @@ FallbackProfile::FallbackProfile()
setProperty(ShowMenuBar,true);
setProperty(StartInCurrentSessionDir,true);
setProperty(ShowNewAndCloseTabButtons,false);
setProperty(MenuIndex,"0");
setProperty(KeyBindings,"default");
setProperty(ColorScheme,"DarkPastels");
@@ -276,6 +278,14 @@ void Profile::registerProperty(const PropertyInfo& info)
_infoByProperty.insert(info.property,info);
}
int Profile::menuIndexAsInt() const
{
bool ok;
int index = menuIndex().toInt(&ok, 10);
if (ok) return index;
return 0;
}
QString KDE4ProfileWriter::getPath(const Profile::Ptr info)
{
QString newPath;