Skip to content

Commit

Permalink
Fix compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ncravino committed Dec 8, 2023
1 parent 0b47b0e commit 9cab612
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/editor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

#include "editor.hpp"

#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
#define SKIPEMPTYPARTS Qt::SkipEmptyParts
#else
#define SKIPEMPTYPARTS QString::SkipEmptyParts
#endif

static inline void save_txt(Ui::MainWindow * main_ui, QString & current_file){
assert(!current_file.isEmpty());
QFile f(current_file);
Expand Down Expand Up @@ -258,7 +264,7 @@ void Editor::setup_status_events(){
auto text = this->main->editor->toPlainText();
const QRegularExpression word_delim_regex = QRegularExpression("\\s+");

word_count = text.split(word_delim_regex, Qt::SkipEmptyParts).count();
word_count = text.split(word_delim_regex, SKIPEMPTYPARTS).count();
line_count = this->main->editor->document()->lineCount();
char_count = this->main->editor->document()->characterCount();

Expand Down Expand Up @@ -348,6 +354,7 @@ Editor::Editor(int argc, char ** argv){
this->window = new QMainWindow();
this->main = new Ui::MainWindow();

this->app->setWindowIcon(this->icon);
QApplication::setWindowIcon(this->icon);
QApplication::setDesktopFileName("com.ncravino.giduba"); //needed for wayland et al to show icon in window

Expand Down

0 comments on commit 9cab612

Please sign in to comment.