mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
Merge branch 'staged' into dev
This commit is contained in:
commit
af72c97ce4
|
@ -2106,7 +2106,7 @@ void ArticleView::highlightFTSResults()
|
|||
QString script = QString(
|
||||
"var context = document.querySelector(\"body\");\n"
|
||||
"var instance = new Mark(context);\n instance.unmark();\n"
|
||||
"instance.mark(\"%1\");" )
|
||||
"instance.mark(\"%1\",{\"accuracy\": \"exactly\"});" )
|
||||
.arg( regString );
|
||||
|
||||
webview->page()->runJavaScript( script );
|
||||
|
|
|
@ -1216,6 +1216,32 @@ void MainWindow::commitData()
|
|||
if ( d.exists() ) {
|
||||
d.removeRecursively();
|
||||
}
|
||||
//temp dir
|
||||
QDir dtemp( filePath + "_FTS_x_temp" );
|
||||
if ( dtemp.exists() ) {
|
||||
dtemp.removeRecursively();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//remove temp directories.
|
||||
QFileInfoList const dirs = dir.entryInfoList( QDir::Dirs | QDir::NoDotAndDotDot );
|
||||
|
||||
for ( auto & file : dirs ) {
|
||||
QString const fileName = file.fileName();
|
||||
|
||||
if ( !fileName.endsWith( "_temp" ) )
|
||||
continue;
|
||||
|
||||
const QFileInfo info( fileName );
|
||||
const QDateTime lastModified = info.lastModified();
|
||||
|
||||
//if the temp directory has not been modified within 7 days,remove the temp directory.
|
||||
if ( lastModified.addDays( 7 ) > QDateTime::currentDateTime() ) {
|
||||
continue;
|
||||
}
|
||||
QDir d( fileName );
|
||||
d.removeRecursively();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2751,7 +2777,6 @@ void MainWindow::toggleMainWindow( bool onlyShow )
|
|||
if ( !cfg.preferences.searchInDock )
|
||||
translateBox->setPopupEnabled( false );
|
||||
|
||||
qDebug() << "Current state:" << isVisible() << isMinimized() << isActiveWindow() << onlyShow;
|
||||
if ( !isVisible() ) {
|
||||
show();
|
||||
|
||||
|
|
|
@ -593,7 +593,8 @@ void ScanPopup::currentGroupChanged( int )
|
|||
|
||||
if ( isVisible() ) {
|
||||
updateSuggestionList();
|
||||
translateInputFinished();
|
||||
QString word = Folding::unescapeWildcardSymbols( definition->getWord() );
|
||||
showTranslationFor( word );
|
||||
}
|
||||
|
||||
cfg.lastPopupGroupId = ui.groupList->getCurrentGroup();
|
||||
|
|
Loading…
Reference in a new issue