mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
fix:check scanPopup existence
This commit is contained in:
parent
4f2c8d55aa
commit
84798c56ea
|
@ -819,7 +819,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
||||||
applyQtStyleSheet( cfg.preferences.addonStyle, cfg.preferences.displayStyle, cfg.preferences.darkMode );
|
applyQtStyleSheet( cfg.preferences.addonStyle, cfg.preferences.displayStyle, cfg.preferences.darkMode );
|
||||||
|
|
||||||
// Scanpopup related
|
// Scanpopup related
|
||||||
scanPopup = new ScanPopup(nullptr, cfg, articleNetMgr, audioPlayerFactory.player(),
|
scanPopup = new ScanPopup(this, cfg, articleNetMgr, audioPlayerFactory.player(),
|
||||||
dictionaries, groupInstances, history );
|
dictionaries, groupInstances, history );
|
||||||
|
|
||||||
scanPopup->setStyleSheet(styleSheet());
|
scanPopup->setStyleSheet(styleSheet());
|
||||||
|
@ -937,6 +937,10 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
||||||
|
|
||||||
void MainWindow::clipboardChange( QClipboard::Mode m)
|
void MainWindow::clipboardChange( QClipboard::Mode m)
|
||||||
{
|
{
|
||||||
|
if( !scanPopup )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(HAVE_X11)
|
#if defined(HAVE_X11)
|
||||||
if(m == QClipboard::Clipboard){
|
if(m == QClipboard::Clipboard){
|
||||||
|
@ -1154,8 +1158,8 @@ void MainWindow::commitData()
|
||||||
cfg.mainWindowGeometry = saveGeometry();
|
cfg.mainWindowGeometry = saveGeometry();
|
||||||
|
|
||||||
// Save popup window state and geometry
|
// Save popup window state and geometry
|
||||||
|
if( scanPopup )
|
||||||
scanPopup->saveConfigData();
|
scanPopup->saveConfigData();
|
||||||
|
|
||||||
// Save any changes in last chosen groups etc
|
// Save any changes in last chosen groups etc
|
||||||
try
|
try
|
||||||
|
|
|
@ -154,7 +154,7 @@ private:
|
||||||
|
|
||||||
WordFinder wordFinder;
|
WordFinder wordFinder;
|
||||||
|
|
||||||
ScanPopup * scanPopup;
|
ScanPopup * scanPopup = nullptr;
|
||||||
|
|
||||||
sptr< HotkeyWrapper > hotkeyWrapper;
|
sptr< HotkeyWrapper > hotkeyWrapper;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue