generic: drop temporary file option

any program launched with temporary file (as per the spec) argument
(because it does not support %u or %U) should not be responsible for
deleting the file, klauncher already handles that thus the option is
redundant. I don't know how other implemenatations (of program launchers)
do it but I cannot say I care either

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-16 01:37:20 +03:00
parent c91e594827
commit 8c8855d9a6
4 changed files with 1 additions and 35 deletions

View file

@ -1522,8 +1522,7 @@ KUrl KCmdLineArgs::makeURL(const QByteArray &_urlArg)
return KUrl(urlArg); // Argument is a URL return KUrl(urlArg); // Argument is a URL
} }
void void KCmdLineArgsPrivate::addArgument(const QByteArray &argument)
KCmdLineArgsPrivate::addArgument(const QByteArray &argument)
{ {
if (!parsedArgList) if (!parsedArgList)
parsedArgList = new KCmdLineParsedArgs; parsedArgList = new KCmdLineParsedArgs;
@ -1531,20 +1530,6 @@ KCmdLineArgsPrivate::addArgument(const QByteArray &argument)
parsedArgList->append(argument); parsedArgList->append(argument);
} }
void
KCmdLineArgs::addTempFileOption()
{
KCmdLineOptions tmpopt;
tmpopt.add( "tempfile", ki18n("The files/URLs opened by the application will be deleted after use") );
KCmdLineArgs::addCmdLineOptions( tmpopt, ki18n("KDE-tempfile"), "kde-tempfile" );
}
bool KCmdLineArgs::isTempFileSet()
{
KCmdLineArgs* args = KCmdLineArgs::parsedArgs( "kde-tempfile" );
return args && args->isSet( "tempfile" );
}
QStringList KCmdLineArgs::allArguments() QStringList KCmdLineArgs::allArguments()
{ {
QStringList lst; QStringList lst;

View file

@ -598,18 +598,6 @@ public:
*/ */
static void saveAppArgs( QDataStream &); static void saveAppArgs( QDataStream &);
/**
* Add standard option --tempfile
*/
static void addTempFileOption();
// this avoids having to know the "id" used by addTempFileOption
// but this approach doesn't scale well, we can't have 50 standard options here...
/**
* @return true if --tempfile was set
*/
static bool isTempFileSet();
/** /**
* Returns the number of arguments returned by qtArgv() * Returns the number of arguments returned by qtArgv()
* *

View file

@ -39,10 +39,6 @@
* your application can only be opened once per user or once per host, you * your application can only be opened once per user or once per host, you
* need to ensure this independently of KUniqueApplication. * need to ensure this independently of KUniqueApplication.
* *
* If your application is used to open files, it should also support the --tempfile
* option (see KCmdLineArgs::addTempFileOption()), to delete tempfiles after use.
* Add X-KDE-HasTempFileOption=true to the .desktop file to indicate this.
*
* @see KApplication * @see KApplication
* @author Preston Brown <pbrown@kde.org> * @author Preston Brown <pbrown@kde.org>
*/ */

View file

@ -127,8 +127,5 @@ Type=QStringList
[PropertyDef::X-KDE-ParentApp] [PropertyDef::X-KDE-ParentApp]
Type=QString Type=QString
[PropertyDef::X-KDE-HasTempFileOption]
Type=bool
[PropertyDef::X-KDE-Protocols] [PropertyDef::X-KDE-Protocols]
Type=QStringList Type=QStringList