~ubuntu-branches/ubuntu/maverick/kdebase/maverick-updates

« back to all changes in this revision

Viewing changes to apps/konsole/src/ShellCommand.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Debian Qt/KDE Maintainers, Martin Alfke, Modestas Vainius
  • Date: 2010-05-01 23:37:50 UTC
  • mfrom: (0.7.4 upstream) (0.4.4 experimental)
  • mto: This revision was merged to the branch mainline in revision 285.
  • Revision ID: james.westby@ubuntu.com-20100501233750-maq4i4sh8ymjbneb
Tags: 4:4.4.3-1
* New upstream release:
  - Konsole does not crash when closing a broken restored session.
    (Closes: #555831)
  - Konqueror does not crash when closing fast a tab. (Closes: #441298)

[Martin Alfke]
* Update of debian/copyright for kde 4.4

[ Modestas Vainius ]
* Bump kde-sc-dev-latest build dependency to 4.4.3.
* Confirm symbol files for 4.4.2 on hurd-i386 i386 ia64 kfreebsd-amd64
  kfreebsd-i386 mips powerpc s390 sparc.
* Release KDE SC 4.4.3 to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "ShellCommand.h"
22
22
 
23
23
// Qt
 
24
#include <KShell>
24
25
#include <KDebug>
25
26
 
26
27
using namespace Konsole;
31
32
 
32
33
ShellCommand::ShellCommand(const QString& fullCommand)
33
34
{
34
 
    bool inQuotes = false;
35
 
 
36
 
    QString builder;
37
 
 
38
 
    for ( int i = 0 ; i < fullCommand.count() ; i++ )
39
 
    {
40
 
        QChar ch = fullCommand[i];
41
 
 
42
 
        const bool isLastChar = ( i == fullCommand.count() - 1 );
43
 
        const bool isQuote = ( ch == '\'' || ch == '\"' );
44
 
 
45
 
        if ( !isLastChar && isQuote )
46
 
            inQuotes = !inQuotes;
47
 
        else
48
 
        { 
49
 
            if ( (!ch.isSpace() || inQuotes) && !isQuote )
50
 
                builder.append(ch);
51
 
 
52
 
            if ( (ch.isSpace() && !inQuotes) || ( i == fullCommand.count()-1 ) )
53
 
            {
54
 
                _arguments << builder;      
55
 
                builder.clear(); 
56
 
            }
57
 
        }
58
 
    }
 
35
    _arguments = KShell::splitArgs(fullCommand);
59
36
}
60
37
ShellCommand::ShellCommand(const QString& command , const QStringList& arguments)
61
38
{