Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix undeclared void MainWindow::Love() #6775

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix undeclared void MainWindow::Love() #6775

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 15, 2020

Error from compilation:

/home/dev/AUR/clementine-git/src/Clementine/src/ui/mainwindow.cpp:1583:6: error: no declaration matches ‘void MainWindow::Love()’
 1583 | void MainWindow::Love() {
      |      ^~~~~~~~~~
/home/dev/AUR/clementine-git/src/Clementine/src/ui/mainwindow.cpp:1583:6: note: no functions named ‘void MainWindow::Love()’
In file included from /home/dev/AUR/clementine-git/src/Clementine/src/ui/mainwindow.cpp:18:
/home/dev/AUR/clementine-git/src/Clementine/src/ui/mainwindow.h:91:7: note: ‘class MainWindow’ defined here
   91 | class MainWindow : public QMainWindow, public PlatformInterface {
      |       ^~~~~~~~~~
cc1plus: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-unused-private-field’ may have been intended to silence earlier diagnostics
make[2]: *** [src/CMakeFiles/clementine_lib.dir/build.make:7017: src/CMakeFiles/clementine_lib.dir/ui/mainwindow.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:875: src/CMakeFiles/clementine_lib.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

In mainwindow.h L224

#ifdef HAVE_LIBLASTFM
  void ScrobblingEnabledChanged(bool value);
  void Love();
  void ScrobbledRadioStream();
#endif

@ghost
Copy link
Author

ghost commented Aug 15, 2020

Build is successful and clementine works fine after applying my patch

@ghost
Copy link
Author

ghost commented Aug 15, 2020

If you try the opposite and get that function out of #ifdef HAVE_LIBLASTFM in mainwindow.h with putting the condition related to lastfm in mainwindow.cpp ( void MainWindow::Love() )

#ifdef HAVE_LIBLASTFM
else {
    app_->scrobbler()->Love();
    ui_->action_love->setEnabled(false);
    if (tray_icon_) tray_icon_->LastFMButtonLoveStateChanged(false);
  }
#endif

it will compile but it won't work since that button will only show up if you have HAVE_LIBLASTFM defined so I think my patch is the best way to fix this.

@ghost
Copy link
Author

ghost commented Aug 15, 2020

I just added a small fix since the love button doesn't show up anyways when you don't have liblastfm.

@lumip
Copy link
Contributor

lumip commented May 26, 2021

I think the underlying issue here was fixed by pulling the declaration of Love out of the #ifdef block in mainwindow.h. As this is therefore outdated, I think PR can be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant