Skip to content

Commit

Permalink
- [v0.11.1] Regression, autoInit was invoked too late the new contruc…
Browse files Browse the repository at this point in the history
…tor setup of #156
  • Loading branch information
gamecreature committed Mar 5, 2025
1 parent a8505d4 commit 038d35f
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog

- (2025-03-05) [v0.11.1] Regression, autoInit was invoked too late the new contructor setup of #156
- (2025-03-04) Update license headers
- (2025-03-04) Update doxygen so it uses Doxygen Awesome
- (2025-03-04) #156, Allow creation with predefined TextEditorConfig, TextEditorController or TextDocument
Expand Down
4 changes: 2 additions & 2 deletions edbee-lib/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = "edbee - Qt Editor Library"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "v0.10.0"
PROJECT_NUMBER = "v0.11.1"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewers a
Expand All @@ -74,7 +74,7 @@ PROJECT_ICON =
# entered, it will be relative to the location where Doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = "../edbee-lib-doxydocs/v0.10.0"
OUTPUT_DIRECTORY = "../edbee-lib-doxydocs/v0.11.1"

# If the CREATE_SUBDIRS tag is set to YES then Doxygen will create up to 4096
# sub-directories (in 2 levels) under the output directory of each output format
Expand Down
6 changes: 3 additions & 3 deletions edbee-lib/edbee/edbeeversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#pragma once

#define EDBEE_VERSION "0.10.0"
#define EDBEE_VERSION "0.11.1"

#define EDBEE_VERSION_MAJOR 0
#define EDBEE_VERSION_MINOR 10
#define EDBEE_VERSION_PATCH 0
#define EDBEE_VERSION_MINOR 11
#define EDBEE_VERSION_PATCH 1
#define EDBEE_VERSION_POSTFIX ""
3 changes: 3 additions & 0 deletions edbee-lib/edbee/models/chardocument/chartextdocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ CharTextDocument::CharTextDocument(TextEditorConfig *config, QObject *object)
{
Q_ASSERT_GUI_THREAD;

// auto initialize edbee if this hasn't been done already
Edbee::instance()->autoInit();

textBuffer_ = new CharTextBuffer();

textScopes_ = new TextDocumentScopes( this );
Expand Down
2 changes: 1 addition & 1 deletion edbee-lib/edbee/models/textdocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void TextDocument::giveLineData(int line, int field, TextLineData* dataItem)
TextLineData* TextDocument::getLineData(int line, int field)
{
int len = lineDataManager()->length();
Q_ASSERT( len == lineCount() );
// Q_ASSERT( len == lineCount() ); FIXME: disabled, issue with renderer retreiving linedata
Q_ASSERT( line < len );
return lineDataManager()->get( line, field );
}
Expand Down
3 changes: 3 additions & 0 deletions edbee-lib/edbee/texteditorcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ TextEditorController::TextEditorController(TextDocument *document, TextEditorWid
, autoScrollToCaret_(AutoScrollAlways)
, borderedTextRanges_(nullptr)
{
// auto initialize edbee if this hasn't been done already
Edbee::instance()->autoInit();

// create the keymap
keyMapRef_ = Edbee::instance()->defaultKeyMap();
commandMapRef_ = Edbee::instance()->defaultCommandMap();
Expand Down
3 changes: 0 additions & 3 deletions edbee-lib/edbee/texteditorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ TextEditorWidget::TextEditorWidget(TextEditorController *controller, QWidget* pa
, autoScrollMargin_(50)
, readonly_(false)
{
// auto initialize edbee if this hasn't been done already
Edbee::instance()->autoInit();

// setup the ui
scrollAreaRef_ = new class TextEditorScrollArea(this);
scrollAreaRef_->setWidgetResizable(true);
Expand Down
30 changes: 17 additions & 13 deletions edbee-test/edbee/models/textlinedatatest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class DestructorTestList : public TextLineDataList
/// Tests the line data manager
void TextLineDataTest::testLineDataManager()
{

TextLineDataManager ldm;
testEqual( filledTestString(ldm ), "-");

Expand All @@ -60,6 +59,7 @@ void TextLineDataTest::testLineDataManager()
testEqual( destroyCount, 0 );
testEqual( destructCount, 0 );


// inserting an item should move the data items
ldm.fillWithEmpty(1,0,1);
testEqual( filledTestString(ldm ), "--X-");
Expand All @@ -83,7 +83,7 @@ void TextLineDataTest::testLineDataManager()
testEqual( filledTestString(ldm ), "--");
testEqual( destroyCount, 1 );
testEqual( destructCount, 1 );

qDebug() << "E";
}

/// References issue #66 github
Expand All @@ -98,28 +98,32 @@ void TextLineDataTest::testSetTextLineDataIssue66()
TextEditorController* controller = widget.controller();
TextLineDataManager* tdm = doc->lineDataManager();

//qDebug()<<"\n ========================================";
//qDebug()<< "setText(a\\nb\\nc)" ;

qDebug()<<"\n ========================================";
qDebug()<< "setText(a\\nb\\nc)" ;
doc->setText("a\nb\nc");
testEqual(filledTestString(*tdm), "---");
// qDebug() << "- a:" << filledTestString(*tdm);
qDebug() << "- a:" << filledTestString(*tdm);

//qDebug()<<"\n ========================================";
//qDebug()<< "setText(a\\nb)" ;
qDebug()<<"\n ========================================";
qDebug()<< "setText(a\\nb)" ;
doc->setText("a\nb");
testEqual(filledTestString(*tdm), "--");
// qDebug() << "- b:" << filledTestString(*tdm);
qDebug() << "- b:" << filledTestString(*tdm);
qDebug() << "G";

//qDebug()<<"\n ========================================";
//qDebug()<< "undo()";
qDebug()<<"\n ========================================";
qDebug()<< "undo()";
controller->undo();
testEqual( filledTestString(*tdm), "---");
// qDebug() << "- c:" << filledTestString(*tdm);
qDebug() << "- c:" << filledTestString(*tdm);
qDebug() << "H";

// exit(1);
//qDebug()<<"\n ========================================";
//qDebug()<< "setText(a)";
qDebug()<<"\n ========================================";
qDebug()<< "setText(a)";
doc->setText("a");
qDebug() << "I";
}

} // edbee

0 comments on commit 038d35f

Please sign in to comment.