fix #152,support an alternative session

-- On The Road was renamed at Alternative
Session and more improvements to the code
were added
v0.6
Michail Vourlakos 8 years ago
parent 3eeb1fe794
commit 11a24ff34c

@ -433,8 +433,8 @@ void DockCorona::syncDockViews()
} }
bool onPrimary = cont->config().readEntry("onPrimary", true); bool onPrimary = cont->config().readEntry("onPrimary", true);
Plasma::Types::Location location = (Plasma::Types::Location)((int)cont->config().readEntry("location", (int)Plasma::Types::BottomEdge)); Plasma::Types::Location location = static_cast<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)); 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 //! 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 //! 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}; int count{0};
foreach (auto cont, containments()) { 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) if (session == ses)
count++; count++;
@ -1025,7 +1025,7 @@ bool DockCorona::heuresticForLoadingDockWithTasks()
if (plugin == "org.kde.latte.containment") { if (plugin == "org.kde.latte.containment") {
bool onPrimary = containmentsEntries.group(cId).readEntry("onPrimary", true); bool onPrimary = containmentsEntries.group(cId).readEntry("onPrimary", true);
int lastScreen = containmentsEntries.group(cId).readEntry("lastScreen", -1); 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; qDebug() << "containment values: " << onPrimary << " - " << lastScreen;

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

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

Loading…
Cancel
Save