Skip to content

Fix undeclared void MainWindow::Love()#6775

Open
ghost wants to merge 2 commits intomasterfrom
unknown repository
Open

Fix undeclared void MainWindow::Love()#6775
ghost wants to merge 2 commits intomasterfrom
unknown repository

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