mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
feat: add dict://
handler to linux
* Remove any thing before first occurance of :// * so that user may add custom handler by just changing the .desktop file
This commit is contained in:
parent
81e1b5d9a6
commit
9716acb2ee
|
@ -7,4 +7,4 @@ GenericName=Multiformat Dictionary
|
|||
Comment=A feature-rich dictionary lookup program
|
||||
Icon=goldendict
|
||||
Exec=goldendict %u
|
||||
MimeType=x-scheme-handler/goldendict
|
||||
MimeType=x-scheme-handler/goldendict;x-scheme-handler/dict;
|
||||
|
|
|
@ -175,8 +175,8 @@ void processCommandLine( QCoreApplication * app, GDOptions * result)
|
|||
result->word = posArgs.at( 0 );
|
||||
|
||||
#if defined( Q_OS_LINUX ) || defined( Q_OS_WIN )
|
||||
// handle url scheme like "goldendict://" on windows
|
||||
result->word.remove( "goldendict://" );
|
||||
// handle url scheme like "goldendict://" or "dict://" on windows/linux
|
||||
result->word.remove( 0, result->word.indexOf( "://" ) + 3 );
|
||||
// In microsoft Words, the / will be automatically appended
|
||||
if ( result->word.endsWith( "/" ) ) {
|
||||
result->word.chop( 1 );
|
||||
|
|
Loading…
Reference in a new issue