abraunegg / onedrive

OneDrive Client for Linux
https://abraunegg.github.io
GNU General Public License v3.0
9.91k stars 857 forks source link

Feature Request: Don't print the d-bus WARNING if disable_notifications is set on cmd line or in config #2840

Open gitbls opened 5 hours ago

gitbls commented 5 hours ago

Is your feature request related to a problem? Please describe.

My debian system runs without a complete desktop. d-bus is runing, but there's no "full desktop". When onedrive v2.5.0-1+np2+2.1 starts, this message is displayed:

blsodb@mondo~> onedrive --sync --upload-only --enable-logging  --disable-notifications
WARNING: D-Bus message bus daemon is not available; GUI notifications are disabled
Reading configuration file: /home/blsodb/.config/onedrive/config
Configuration file successfully loaded

I don't know about you, but when I see a WARNING mesasge, my blood pressure goes up a few points.

Describe the solution you'd like

When --disable-notifications is on the command line or disable_notifications="true" in the config file, the warning message shouldn't be printed.

Describe alternatives you've considered

I could live with it, but my blood pressure...😵

Thanks for considering this.

Additional context

No response

abraunegg commented 3 hours ago

@gitbls

Please can you compile the following PR:

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/2841/head:pr2841
git checkout pr2841

To build the PR, please follow the steps to prepare your system to build the client as detailed here: https://github.com/abraunegg/onedrive/blob/master/docs/install.md#building-from-source---high-level-requirements

When building the client, please use the following:

./configure --enable-debug --enable-notifications; make clean; make;

When running the PR, your version should be: onedrive v2.5.0-6-g3bf292b or greater.

Evidence of fix:

 ./onedrive -s -v --disable-notifications
Reading configuration file: /home/alex/.config/onedrive/config
Configuration file successfully loaded
Using 'user' configuration path for application config and state data: /home/alex/.config/onedrive
Disabling GUI notifications as per user configuration
Using IPv4 and IPv6 (if configured) for all network operations
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
gitbls commented 2 hours ago

Yes, that fixes it. Thank you for fixing it so that the config file setting works in addition to the command line.

abraunegg commented 2 hours ago

@gitbls Thanks for confirmation - will merge this into 'master' now