mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
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:
parent
c91e594827
commit
8c8855d9a6
4 changed files with 1 additions and 35 deletions
|
@ -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;
|
||||||
|
|
|
@ -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()
|
||||||
*
|
*
|
||||||
|
|
|
@ -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>
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue