Skip to content

Commit

Permalink
Moved TED to QT5.9.2, added modifications from Dawlane
Browse files Browse the repository at this point in the history
Moved TED to QT5.9.2, added modifications from Dawlane
  • Loading branch information
MikeHart66 committed Dec 30, 2018
1 parent 2457fc7 commit 5d01c19
Show file tree
Hide file tree
Showing 33 changed files with 1,526 additions and 343 deletions.
5 changes: 3 additions & 2 deletions VERSIONS.TXT
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
***** v2018-12-25 *****
***** v2018-12-30 *****

FIX: [AGK_IOS] Fixed AGK_IOS target showing up on non OSX platforms.
FIX: [ANDROID] Fixed MIN_SDK, TARGET and TOOLS version.
FIX: [brl.requesters] Fixed RequestFile not working with a set path.
FIX: [TED] Fixed selecting a help topic in the toolbar didn't show up the help file directly.
MOD: [example] Various changes to sample scripts (Author: Paul59)
FIX: [TED] Fixed "Open on Desktop" on Linux.
FIX: [TED] Fixed "Open on Desktop" on Linux. (Author: Dawlane)
MOD: [TED] If text is selected in the editor, it will be pre set in the Find dialog.
MOD: [DOCS/MAKEDOCS] Numerous changes to the docs and MakeDocs itself.
FIX: [GLFW/GLFW-ANGLE] Fixed returning MouseZ resets MouseX and MouseY to zero.
MOD: [TED] Bigger changes so TED uses the QT5 webengine now and needs QT5.9.2 to compile. (Author: Dawlane)

***** v2018-08-10 *****

Expand Down
2 changes: 1 addition & 1 deletion bin/docstyle.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cerberusx3b
cerberusx3
8 changes: 7 additions & 1 deletion src/makedocs/makedocs.build/cpptool/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3942,7 +3942,7 @@ String c_Makedocs::p_BuildDocLink(c_DocDecl* t_pDecl,c_DocDecl* t_pScope){
void c_Makedocs::p_WriteDeclFiles(){
p_ClearErrInfo();
m_curdecl=m_rootmodules;
c_DocDeclStack* t_alldecls=m_rootmodules->p_GetChilds2(0,true);
c_DocDeclStack* t_alldecls=m_rootdecl->p_GetChilds2(0,true);
String t_txt=String();
c_StringMap4* t_idx=(new c_StringMap4)->m_new();
c_Enumerator2* t_=t_alldecls->p_ObjectEnumerator();
Expand All @@ -3956,6 +3956,12 @@ void c_Makedocs::p_WriteDeclFiles(){
String t_str=String(L"Index.html#",11)+t_d->m_ident;
t_idx->p_Set2(t_d->m_ident,t_str);
}
}else{
if(t_8==902){
if(t_d->p_GetTextOfChild(201)==String(L"Programming/Keywords/",21)){
t_idx->p_Add5(t_d->m_ident,p_BuildDocLink(t_d,0));
}
}
}
}
c_NodeEnumerator* t_2=t_idx->p_ObjectEnumerator();
Expand Down
Binary file removed src/makedocs/makedocs.build/cpptool/main_winnt.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions src/ted/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>ted_macos</string>
<string>Ted</string>
<key>CFBundleName</key>
<string>Ted</string>
<key>CFBundleDisplayName</key>
<string>Ted</string>
<key>CFBundleIdentifier</key>
<string>com.krautapps.Ted</string>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
<key>CFBundleDocumentTypes</key>
Expand Down
496 changes: 496 additions & 0 deletions src/ted/Makefile

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions src/ted/cerberusapplication.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include "cerberusapplication.h"


CerberusApplication::CerberusApplication(int &argc, char **argv) : QApplication(argc, argv)
{
#ifdef Q_OS_MACX
firstRun=true;
#endif
}

CerberusApplication::~CerberusApplication()
{
delete mainWindow;
}

#ifdef Q_OS_MACX
void CerberusApplication::processFiles()
{
if(!files.empty()){
foreach(QString file, files){
CerberusApplication::mainWindow->openFile(file, true);
}
}
firstRun=false;
}

// Capture any Mac OS X events. Only interested in the FileOpen event here.
bool CerberusApplication::event(QEvent *event)
{
if(event->type()==QEvent::FileOpen)
{
QFileOpenEvent * fileOpenEvent = static_cast<QFileOpenEvent *>(event);
if(fileOpenEvent)
{
if(firstRun){
if(fileOpenEvent->file() != "") files.append(fileOpenEvent->file());
} else {
if(fileOpenEvent->file() != "") mainWindow->openFile(fileOpenEvent->file(), true);
}
}
}
return QApplication::event(event);
}
#endif
25 changes: 25 additions & 0 deletions src/ted/cerberusapplication.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef CERBERUSAPPLICATION_H
#define CERBERUSAPPLICATION_H

#include <QApplication>
#include <QFileOpenEvent>
#include "mainwindow.h"

class CerberusApplication : public QApplication
{
Q_OBJECT

public:
CerberusApplication(int &argc, char **argv);
~CerberusApplication();
static MainWindow *mainWindow;
#ifdef Q_OS_MACX
void processFiles();
private:
QStringList files;
bool firstRun;
bool event(QEvent *event);
#endif
};

#endif // CERBERUSAPPLICATION_H
60 changes: 60 additions & 0 deletions src/ted/cerberusguard.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
Class to allow only a single instance of a running version of Ted.
*/
#include "cerberusguard.h"

// Connet the classes own QLocalServer to call the newConnection method.
CerberusGuard::CerberusGuard(QObject *parent) : QObject(parent)
{
connect(&m_server, SIGNAL(newConnection()), this, SLOT(newConnection()));
}

// Close the lisening server. This will also close the socket.
CerberusGuard::~CerberusGuard()
{
m_server.close();
}

// Stop listening to the old and start lisening to a new connection.
void CerberusGuard::listen(QString name)
{
m_server.removeServer(name);
m_server.listen(name);
}

// Create a socket and when the connection is established, buffer the arguments pased
// Before writting them out to the socket.
bool CerberusGuard::hasPrevious(QString name, QStringList arguments)
{
QLocalSocket socket;
socket.connectToServer(name);
if(socket.waitForConnected())
{
QByteArray buffer;
foreach(QString item, arguments)
{
buffer.append(item+"\n");
}
socket.write(buffer);
socket.waitForBytesWritten();
return true;
}
return false;
}

// Make a new connection and connet the socket to the readyRead method.
void CerberusGuard::newConnection()
{
emit newInstance();
m_socket=m_server.nextPendingConnection();
connect(m_socket, SIGNAL(readyRead()), this, SLOT(readyRead()));
}

// Make a temporary socket, read and convert the stream passed before passing it to the MainWindow.
void CerberusGuard::readyRead()
{
QLocalSocket *socket = qobject_cast<QLocalSocket*>(sender());
QStringList list = QString(socket->readAll()).split("\n");
CerberusApplication::mainWindow->parseAppArgs(list);
socket->deleteLater();
}
27 changes: 27 additions & 0 deletions src/ted/cerberusguard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef CERBERUSGUARD_H
#define CERBERUSGUARD_H
#include <QObject>
#include <QLocalServer>
#include <QLocalSocket>
#include "cerberusapplication.h"

class CerberusGuard : public QObject
{
Q_OBJECT
public:
explicit CerberusGuard(QObject *parent = 0);
~CerberusGuard();

void listen(QString name);
bool hasPrevious(QString name, QStringList arguments);
signals:
void newInstance();
public slots:
void newConnection();
void readyRead();
private:
QLocalServer m_server;
QLocalSocket *m_socket;
};

#endif // CERBERUSGUARD_H
24 changes: 12 additions & 12 deletions src/ted/codeeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static void flushExtraSels(){
if( !extraSelsEditor ) return;
extraSels.clear();
extraSelsEditor->setExtraSelections( extraSels );
extraSelsEditor=0;
extraSelsEditor=nullptr;
}


Expand All @@ -32,7 +32,7 @@ bool caseInsensitiveLessThan(const QString &a, const QString &b)

class CodeTreeItem : public QStandardItem{
public:
CodeTreeItem():_data(0){
CodeTreeItem():_data(nullptr){
setEditable( false );
}

Expand Down Expand Up @@ -88,10 +88,10 @@ CodeEditor::CodeEditor( QWidget *parent, MainWindow *wnd ):QPlainTextEdit( paren

lineNumberArea = new LineNumberArea(this);

_codeTreeModel=new QStandardItemModel( 0 );//this );
_codeTreeModel=new QStandardItemModel( nullptr );//this );
_codeTreeModel->setSortRole(Qt::AscendingOrder);

_codeTreeView=new QTreeView( 0 );
_codeTreeView=new QTreeView( nullptr );
_codeTreeView->setHeaderHidden( true );
_codeTreeView->setModel( _codeTreeModel );
_codeTreeView->setFocusPolicy( Qt::NoFocus );
Expand Down Expand Up @@ -859,7 +859,7 @@ void CodeEditor::keyPressEvent( QKeyEvent *e ){
cursor.insertText( '\n'+text.left( i ) );
ensureCursorVisible();
e->accept();
e=0;
e=nullptr;
}
}

Expand Down Expand Up @@ -970,7 +970,7 @@ void CodeEditor::populateModel(const QString &completionPrefix)
{
QStringList strings = toPlainText().split(QRegExp("\\W+"));
strings.removeAll(completionPrefix);
if ( _mainWnd != 0) {
if ( _mainWnd != nullptr) {
for( int i=0;i < _mainWnd->_completeList.count();++i ){

QString command=_mainWnd->_completeList.at( i );
Expand Down Expand Up @@ -1006,7 +1006,7 @@ void CodeEditor::insertCompletion(const QString &completion,

bool CodeEditor::findNext( const QString &findText,bool cased,bool wrap ){

QTextDocument::FindFlags flags=0;
QTextDocument::FindFlags flags=nullptr;
if( cased ) flags|=QTextDocument::FindCaseSensitively;

setCenterOnScroll( true );
Expand Down Expand Up @@ -1042,7 +1042,7 @@ bool CodeEditor::replace( const QString &findText,const QString &replaceText,boo

int CodeEditor::replaceAll( const QString &findText,const QString &replaceText,bool cased,bool wrap ){

QTextDocument::FindFlags flags=0;
QTextDocument::FindFlags flags=nullptr;
if( cased ) flags|=QTextDocument::FindCaseSensitively;

if( wrap ){
Expand Down Expand Up @@ -1474,14 +1474,14 @@ void Highlighter::highlightBlock( const QString &ctext ){

if( st!=-1 ){
setFormat( 0,text.length(),_commentsColor );
setCurrentBlockUserData( 0 );
setCurrentBlockUserData( nullptr );
return;
}
}

if( !_editor->isCode() ){
setFormat( 0,text.length(),_defaultColor );
setCurrentBlockUserData( 0 );
setCurrentBlockUserData( nullptr );
return;
}

Expand Down Expand Up @@ -1517,7 +1517,7 @@ void Highlighter::highlightBlock( const QString &ctext ){
//
//Update user block data for code tree.
//
BlockData *data=0;
BlockData *data=nullptr;

QString decl=tokes.size()>0 ? tokes[0].toLower() : "";
QString ident=tokes.size()>1 ? tokes[1] : "";
Expand Down Expand Up @@ -1660,7 +1660,7 @@ BlockData::BlockData( Highlighter *highlighter,const QTextBlock &block,const QSt
}

void BlockData::invalidate(){
_highlighter=0;
_highlighter=nullptr;
}

BlockData::~BlockData(){
Expand Down
4 changes: 2 additions & 2 deletions src/ted/codeeditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CompleterListModel : public QAbstractListModel
Q_OBJECT

public:
CompleterListModel( QObject *parent=0 ): QAbstractListModel(parent){};
CompleterListModel( QObject *parent=nullptr ): QAbstractListModel(parent){};

int rowCount( const QModelIndex &parent=QModelIndex() )const ;

Expand Down Expand Up @@ -92,7 +92,7 @@ class CodeEditor : public QPlainTextEdit{
Q_OBJECT

public:
CodeEditor( QWidget *parent=0, MainWindow *wnd=0 );
CodeEditor( QWidget *parent=nullptr, MainWindow *wnd=nullptr );
~CodeEditor();

//return true if successful and path updated
Expand Down
2 changes: 2 additions & 0 deletions src/ted/configs/linux/bin/qt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Paths]
Plugins = plugins
2 changes: 2 additions & 0 deletions src/ted/configs/linux/libexec/qt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Paths]
Prefix = ../
Loading

0 comments on commit 5d01c19

Please sign in to comment.