1212#include " src/config/configresolver.h"
1313#include " src/config/configwindow.h"
1414#include " src/core/qguiappcurrentscreen.h"
15+
16+ #ifdef ENABLE_IMGUR
1517#include " src/tools/imgupload/imguploadermanager.h"
1618#include " src/tools/imgupload/storages/imguploaderbase.h"
19+ #include " src/widgets/imguploaddialog.h"
20+ #include " src/widgets/uploadhistory.h"
21+ #endif
22+
1723#include " src/utils/confighandler.h"
1824#include " src/utils/screengrabber.h"
1925#include " src/widgets/capture/capturewidget.h"
2026#include " src/widgets/capturelauncher.h"
21- #include " src/widgets/imguploaddialog.h"
2227#include " src/widgets/infowindow.h"
23- #include " src/widgets/uploadhistory.h"
2428#include < QApplication>
2529#include < QBuffer>
2630#include < QDebug>
@@ -61,13 +65,15 @@ Flameshot::Flameshot()
6165 &QHotkey::activated,
6266 qApp,
6367 [this ]() { gui (); });
68+ #ifdef ENABLE_IMGUR
6469 m_HotkeyScreenshotHistory = new QHotkey (
6570 QKeySequence (ConfigHandler ().shortcut (" SCREENSHOT_HISTORY" )), true , this );
6671 QObject::connect (m_HotkeyScreenshotHistory,
6772 &QHotkey::activated,
6873 qApp,
6974 [this ]() { history (); });
7075#endif
76+ #endif
7177}
7278
7379Flameshot* Flameshot::instance ()
@@ -245,6 +251,7 @@ void Flameshot::info()
245251 }
246252}
247253
254+ #ifdef ENABLE_IMGUR
248255void Flameshot::history ()
249256{
250257 static UploadHistory* historyWidget = nullptr ;
@@ -269,6 +276,7 @@ void Flameshot::history()
269276 historyWidget->raise ();
270277#endif
271278}
279+ #endif
272280
273281void Flameshot::openSavePath ()
274282{
@@ -401,6 +409,7 @@ void Flameshot::exportCapture(const QPixmap& capture,
401409 }
402410 }
403411
412+ #ifdef ENABLE_IMGUR
404413 if (tasks & CR::UPLOAD) {
405414 if (!ConfigHandler ().uploadWithoutConfirmation ()) {
406415 auto * dialog = new ImgUploadDialog ();
@@ -425,6 +434,7 @@ void Flameshot::exportCapture(const QPixmap& capture,
425434 }
426435 });
427436 }
437+ #endif
428438
429439 if (!(tasks & CR::UPLOAD)) {
430440 emit captureTaken (capture);
0 commit comments