author | llornkcor <llornkcor> | 2004-10-08 10:22:20 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-10-08 10:22:20 (UTC) |
commit | 0e41f335c0db28250216a5292a2b7bcee2a1cf4a (patch) (unidiff) | |
tree | cac0c40b6e35117b199b45bf5674215ceeb9abd9 /core/launcher/packageslave.cpp | |
parent | b2e0fd018e1122f65dbbf8ab564e992988f35385 (diff) | |
download | opie-0e41f335c0db28250216a5292a2b7bcee2a1cf4a.zip opie-0e41f335c0db28250216a5292a2b7bcee2a1cf4a.tar.gz opie-0e41f335c0db28250216a5292a2b7bcee2a1cf4a.tar.bz2 |
this patch will add support for QD installing directly to opie device via sync. not functioning until QD 1.7.1 released. should compile for now
Diffstat (limited to 'core/launcher/packageslave.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/packageslave.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/launcher/packageslave.cpp b/core/launcher/packageslave.cpp index 0461432..abbc610 100644 --- a/core/launcher/packageslave.cpp +++ b/core/launcher/packageslave.cpp | |||
@@ -56,24 +56,28 @@ PackageHandler::PackageHandler( QObject *parent, char* name ) | |||
56 | this, SLOT( qcopMessage(const QCString&,const QByteArray&) ) ); | 56 | this, SLOT( qcopMessage(const QCString&,const QByteArray&) ) ); |
57 | #endif | 57 | #endif |
58 | } | 58 | } |
59 | 59 | ||
60 | void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data ) | 60 | void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data ) |
61 | { | 61 | { |
62 | QDataStream stream( data, IO_ReadOnly ); | 62 | QDataStream stream( data, IO_ReadOnly ); |
63 | 63 | ||
64 | if ( msg == "installPackage(QString)" ) { | 64 | if ( msg == "installPackage(QString)" ) { |
65 | QString file; | 65 | QString file; |
66 | stream >> file; | 66 | stream >> file; |
67 | installPackage( file ); | 67 | installPackage( file ); |
68 | } else if ( msg == "installPackage(QString,QString)" ) { | ||
69 | QString file, dest; | ||
70 | stream >> file >> dest; | ||
71 | installPackage( file, dest ); | ||
68 | } else if ( msg == "removePackage(QString)" ) { | 72 | } else if ( msg == "removePackage(QString)" ) { |
69 | QString file; | 73 | QString file; |
70 | stream >> file; | 74 | stream >> file; |
71 | removePackage( file ); | 75 | removePackage( file ); |
72 | } else if ( msg == "addPackageFiles(QString,QString)" ) { | 76 | } else if ( msg == "addPackageFiles(QString,QString)" ) { |
73 | QString location, listfile; | 77 | QString location, listfile; |
74 | stream >> location >> listfile; | 78 | stream >> location >> listfile; |
75 | addPackageFiles( location, listfile); | 79 | addPackageFiles( location, listfile); |
76 | } else if ( msg == "addPackages(QString)" ) { | 80 | } else if ( msg == "addPackages(QString)" ) { |
77 | QString location; | 81 | QString location; |
78 | stream >> location; | 82 | stream >> location; |
79 | addPackages( location ); | 83 | addPackages( location ); |
@@ -84,34 +88,40 @@ void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data ) | |||
84 | } else if ( msg == "cleanupPackages(QString)" ) { | 88 | } else if ( msg == "cleanupPackages(QString)" ) { |
85 | QString location; | 89 | QString location; |
86 | stream >> location; | 90 | stream >> location; |
87 | cleanupPackages( location ); | 91 | cleanupPackages( location ); |
88 | } else if ( msg == "prepareInstall(QString,QString)" ) { | 92 | } else if ( msg == "prepareInstall(QString,QString)" ) { |
89 | QString size, path; | 93 | QString size, path; |
90 | stream >> size; | 94 | stream >> size; |
91 | stream >> path; | 95 | stream >> path; |
92 | prepareInstall( size, path ); | 96 | prepareInstall( size, path ); |
93 | } | 97 | } |
94 | } | 98 | } |
95 | 99 | ||
96 | void PackageHandler::installPackage( const QString &package ) | 100 | void PackageHandler::installPackage( const QString &package, const QString &dest ) |
97 | { | 101 | { |
98 | if ( mNoSpaceLeft ) { | 102 | if ( mNoSpaceLeft ) { |
99 | mNoSpaceLeft = FALSE; | 103 | mNoSpaceLeft = FALSE; |
100 | // Don't emit that for now, I still couldn't test it (Wener) | 104 | // Don't emit that for now, I still couldn't test it (Wener) |
101 | //sendReply( "installFailed(QString)", package ); | 105 | //sendReply( "installFailed(QString)", package ); |
102 | //return; | 106 | //return; |
103 | } | 107 | } |
104 | 108 | ||
105 | currentProcess = new QProcess( QStringList() << "ipkg" << "install" << package ); // No tr | 109 | QStringList cmd; |
110 | cmd << "ipkg"; | ||
111 | if ( !dest.isEmpty() ) { | ||
112 | cmd << "-d" << dest; | ||
113 | } | ||
114 | cmd << "install" << package; | ||
115 | currentProcess = new QProcess( cmd ); // No tr | ||
106 | connect( currentProcess, SIGNAL( processExited() ), SLOT( iProcessExited() ) ); | 116 | connect( currentProcess, SIGNAL( processExited() ), SLOT( iProcessExited() ) ); |
107 | connect( currentProcess, SIGNAL( readyReadStdout() ), SLOT( readyReadStdout() ) ); | 117 | connect( currentProcess, SIGNAL( readyReadStdout() ), SLOT( readyReadStdout() ) ); |
108 | connect( currentProcess, SIGNAL( readyReadStderr() ), SLOT( readyReadStderr() ) ); | 118 | connect( currentProcess, SIGNAL( readyReadStderr() ), SLOT( readyReadStderr() ) ); |
109 | currentPackage = package; | 119 | currentPackage = package; |
110 | 120 | ||
111 | currentProcessError=""; | 121 | currentProcessError=""; |
112 | sendReply( "installStarted(QString)", package ); | 122 | sendReply( "installStarted(QString)", package ); |
113 | currentProcess->start(); | 123 | currentProcess->start(); |
114 | } | 124 | } |
115 | 125 | ||
116 | void PackageHandler::removePackage( const QString &package ) | 126 | void PackageHandler::removePackage( const QString &package ) |
117 | { | 127 | { |