mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
clean code:
remove qt version check save geometry
This commit is contained in:
parent
5eac08c97a
commit
303179b410
|
@ -6,14 +6,12 @@
|
|||
|
||||
#include <QtNetwork>
|
||||
|
||||
#if QT_VERSION >= 0x050300 // Qt 5.3+
|
||||
#include <QSet>
|
||||
#include <QMap>
|
||||
#include <QPair>
|
||||
#include <QWebEngineUrlSchemeHandler>
|
||||
#include <QWebEngineUrlRequestJob>
|
||||
#include <QNetworkAccessManager>
|
||||
#endif
|
||||
|
||||
#include "dictionary.hh"
|
||||
#include "article_maker.hh"
|
||||
|
|
|
@ -185,7 +185,8 @@ QString ArticleView::runJavaScriptSync(QWebEnginePage* frame, const QString& var
|
|||
QObject::connect(this, SIGNAL(notifyJavascriptFinished()), &loop, SLOT(quit()));
|
||||
frame->runJavaScript(variable, [&](const QVariant &v)
|
||||
{
|
||||
result = v.toString();
|
||||
if(v.isValid())
|
||||
result = v.toString();
|
||||
emitJavascriptFinished();
|
||||
});
|
||||
|
||||
|
@ -345,10 +346,8 @@ ArticleView::ArticleView( QWidget * parent, ArticleNetworkAccessManager & nm,
|
|||
|
||||
expandOptionalParts = cfg.preferences.alwaysExpandOptionalParts;
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
|
||||
ui.definition->grabGesture( Gestures::GDPinchGestureType );
|
||||
ui.definition->grabGesture( Gestures::GDSwipeGestureType );
|
||||
#endif
|
||||
|
||||
// Variable name for store current selection range
|
||||
rangeVarName = QString( "sr_%1" ).arg( QString::number( (quint64)this, 16 ) );
|
||||
|
|
|
@ -746,9 +746,9 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
|||
}
|
||||
if( cfg.maximizedMainWindowGeometry.width() > 0 )
|
||||
{
|
||||
// setGeometry( cfg.maximizedMainWindowGeometry );
|
||||
// if ( cfg.mainWindowGeometry.size() )
|
||||
// restoreGeometry( cfg.mainWindowGeometry );
|
||||
setGeometry( cfg.maximizedMainWindowGeometry );
|
||||
if ( cfg.mainWindowGeometry.size() )
|
||||
restoreGeometry( cfg.mainWindowGeometry );
|
||||
if ( cfg.mainWindowState.size() )
|
||||
restoreState( cfg.mainWindowState, 1 );
|
||||
setWindowState( windowState() | Qt::WindowMaximized );
|
||||
|
@ -2456,8 +2456,7 @@ bool MainWindow::eventFilter( QObject * obj, QEvent * ev )
|
|||
{
|
||||
if( !isMaximized() && !isMinimized() && !isFullScreen() )
|
||||
{
|
||||
//todo ,need further effort
|
||||
// setGeometry( cfg.normalMainWindowGeometry );
|
||||
setGeometry( cfg.normalMainWindowGeometry );
|
||||
}
|
||||
ev->accept();
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue