@@ -112,25 +112,25 @@ void PolkitAgent::classBegin() {
112112}
113113
114114void PolkitAgent::componentComplete () {
115- if (!mPath .isEmpty ()) {
116- qCDebug (logPolkit) << " registering listener on path" << mPath ;
117- if (qs_polkit_agent_register (listener)) {
118- registeredAgentsByPath[mPath ] = this ;
119- // If we were previously waiting to acquire this path, we no longer
120- // are.
121- if (auto it = waitingAgentsByPath.find (mPath );
122- it != waitingAgentsByPath.end () && it->second == this )
123- {
124- waitingAgentsByPath.erase (it);
125- }
126- } else {
127- qCWarning (logPolkit) << " failed to register listener on path" << mPath ;
128- // We may be able to register later if the current holder of the path
129- // goes away.
130- waitingAgentsByPath[mPath ] = this ;
115+ if (mPath .isEmpty ()) {
116+ mPath = " /org/quickshell/Polkit" ;
117+ }
118+
119+ qCDebug (logPolkit) << " registering listener on path" << mPath ;
120+ if (qs_polkit_agent_register (listener)) {
121+ registeredAgentsByPath[mPath ] = this ;
122+ // If we were previously waiting to acquire this path, we no longer
123+ // are.
124+ if (auto it = waitingAgentsByPath.find (mPath );
125+ it != waitingAgentsByPath.end () && it->second == this )
126+ {
127+ waitingAgentsByPath.erase (it);
131128 }
132129 } else {
133- qCWarning (logPolkit) << " no path set, not registering listener." ;
130+ qCWarning (logPolkit) << " failed to register listener on path" << mPath ;
131+ // We may be able to register later if the current holder of the path
132+ // goes away.
133+ waitingAgentsByPath[mPath ] = this ;
134134 }
135135}
136136
0 commit comments