fix #152,support an alternative session

-- On The Road was renamed at Alternative
Session and more improvements to the code
were added
pull/1/head
Michail Vourlakos 8 years ago
parent 45e95788ed
commit 4ea4a903fd

@ -433,8 +433,8 @@ void DockCorona::syncDockViews()
}
bool onPrimary = cont->config().readEntry("onPrimary", true);
Plasma::Types::Location location = (Plasma::Types::Location)((int)cont->config().readEntry("location", (int)Plasma::Types::BottomEdge));
Dock::SessionType session = (Dock::SessionType)((int)cont->config().readEntry("session", (int)Dock::DefaultSession));
Plasma::Types::Location location = static_cast<Plasma::Types::Location>((int)cont->config().readEntry("location", (int)Plasma::Types::BottomEdge));
Dock::SessionType session = static_cast<Dock::SessionType>((int)cont->config().readEntry("session", (int)Dock::DefaultSession));
//! two main situations that a dock must be added when it is not already running
//! 1. when a dock is primary, not running and the edge for which is associated is free
@ -673,7 +673,7 @@ int DockCorona::noDocksForSession(Dock::SessionType session)
int count{0};
foreach (auto cont, containments()) {
Dock::SessionType ses = (Dock::SessionType)((int)cont->config().readEntry("session", (int)Dock::DefaultSession));
Dock::SessionType ses = static_cast<Dock::SessionType>(cont->config().readEntry("session", (int)Dock::DefaultSession));
if (session == ses)
count++;
@ -1025,7 +1025,7 @@ bool DockCorona::heuresticForLoadingDockWithTasks()
if (plugin == "org.kde.latte.containment") {
bool onPrimary = containmentsEntries.group(cId).readEntry("onPrimary", true);
int lastScreen = containmentsEntries.group(cId).readEntry("lastScreen", -1);
Dock::SessionType session = (Dock::SessionType)containmentsEntries.group(cId).readEntry("session", (int)Dock::DefaultSession);
Dock::SessionType session = static_cast<Dock::SessionType>(containmentsEntries.group(cId).readEntry("session", (int)Dock::DefaultSession));
qDebug() << "containment values: " << onPrimary << " - " << lastScreen;

@ -56,7 +56,7 @@ public:
enum SessionType {
DefaultSession = 0,
OnTheRoadSession
AlternativeSession
};
Q_ENUM(SessionType)

@ -79,13 +79,13 @@ PlasmaComponents.Page {
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("On The Road")
checked: dockConfig.currentSession === Latte.Dock.OnTheRoadSession
text: i18n("Alternative Session")
checked: dockConfig.currentSession === Latte.Dock.AlternativeSession
checkable: true
onClicked: {
if (dockConfig.currentSession === Latte.Dock.DefaultSession){
dockConfig.currentSession = Latte.Dock.OnTheRoadSession;
dockConfig.currentSession = Latte.Dock.AlternativeSession;
} else {
dockConfig.currentSession = Latte.Dock.DefaultSession;
}

Loading…
Cancel
Save