• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kio
slaveinterface.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 David Faure <faure@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #include "slaveinterface.h"
20 #include "slaveinterface_p.h"
21 
22 #include "slavebase.h"
23 #include "connection.h"
24 #include "hostinfo_p.h"
25 #include <errno.h>
26 #include <assert.h>
27 #include <kdebug.h>
28 #include <stdlib.h>
29 #include <sys/time.h>
30 #include <unistd.h>
31 #include <signal.h>
32 #include <klocale.h>
33 #include <ksslinfodialog.h>
34 #include <kmessagebox.h>
35 #include <time.h>
36 #include <QtDBus/QtDBus>
37 #include <QtCore/QPointer>
38 #include <QtNetwork/QSslCertificate>
39 #include <QtNetwork/QSslError>
40 
41 using namespace KIO;
42 
43 
44 SlaveInterface::SlaveInterface(SlaveInterfacePrivate &dd, QObject *parent)
45  : QObject(parent), d_ptr(&dd)
46 {
47  connect(&d_ptr->speed_timer, SIGNAL(timeout()), SLOT(calcSpeed()));
48 }
49 
50 SlaveInterface::~SlaveInterface()
51 {
52  // Note: no kDebug() here (scheduler is deleted very late)
53 
54  delete d_ptr;
55 }
56 
57 void SlaveInterface::setConnection( Connection* connection )
58 {
59  Q_D(SlaveInterface);
60  d->connection = connection;
61 }
62 
63 Connection *SlaveInterface::connection() const
64 {
65  const Q_D(SlaveInterface);
66  return d->connection;
67 }
68 
69 static KIO::filesize_t readFilesize_t(QDataStream &stream)
70 {
71  KIO::filesize_t result;
72  stream >> result;
73  return result;
74 }
75 
76 bool SlaveInterface::dispatch()
77 {
78  Q_D(SlaveInterface);
79  assert( d->connection );
80 
81  int cmd;
82  QByteArray data;
83 
84  int ret = d->connection->read( &cmd, data );
85  if (ret == -1)
86  return false;
87 
88  return dispatch( cmd, data );
89 }
90 
91 void SlaveInterface::calcSpeed()
92 {
93  Q_D(SlaveInterface);
94  if (d->slave_calcs_speed) {
95  d->speed_timer.stop();
96  return;
97  }
98 
99  struct timeval tv;
100  gettimeofday(&tv, 0);
101 
102  long diff = ((tv.tv_sec - d->start_time.tv_sec) * 1000000 +
103  tv.tv_usec - d->start_time.tv_usec) / 1000;
104  if (diff - d->last_time >= 900) {
105  d->last_time = diff;
106  if (d->nums == max_nums) {
107  // let's hope gcc can optimize that well enough
108  // otherwise I'd try memcpy :)
109  for (unsigned int i = 1; i < max_nums; ++i) {
110  d->times[i-1] = d->times[i];
111  d->sizes[i-1] = d->sizes[i];
112  }
113  d->nums--;
114  }
115  d->times[d->nums] = diff;
116  d->sizes[d->nums++] = d->filesize - d->offset;
117 
118  KIO::filesize_t lspeed = 1000 * (d->sizes[d->nums-1] - d->sizes[0]) / (d->times[d->nums-1] - d->times[0]);
119 
120 // kDebug() << (long)d->filesize << diff
121 // << long(d->sizes[d->nums-1] - d->sizes[0])
122 // << d->times[d->nums-1] - d->times[0]
123 // << long(lspeed) << double(d->filesize) / diff
124 // << convertSize(lspeed)
125 // << convertSize(long(double(d->filesize) / diff) * 1000);
126 
127  if (!lspeed) {
128  d->nums = 1;
129  d->times[0] = diff;
130  d->sizes[0] = d->filesize - d->offset;
131  }
132  emit speed(lspeed);
133  }
134 }
135 
136 #ifndef KDE_USE_FINAL // already defined in slavebase.cpp
137 /*
138  * Map pid_t to a signed integer type that makes sense for QByteArray;
139  * only the most common sizes 16 bit and 32 bit are special-cased.
140  */
141 template<int T> struct PIDType { typedef pid_t PID_t; } ;
142 template<> struct PIDType<2> { typedef qint16 PID_t; } ;
143 template<> struct PIDType<4> { typedef qint32 PID_t; } ;
144 #endif
145 
146 bool SlaveInterface::dispatch(int _cmd, const QByteArray &rawdata)
147 {
148  Q_D(SlaveInterface);
149  //kDebug(7007) << "dispatch " << _cmd;
150 
151  QDataStream stream(rawdata);
152 
153  QString str1;
154  qint32 i;
155  qint8 b;
156  quint32 ul;
157 
158  switch(_cmd) {
159  case MSG_DATA:
160  emit data(rawdata);
161  break;
162  case MSG_DATA_REQ:
163  emit dataReq();
164  break;
165  case MSG_OPENED:
166  emit open();
167  break;
168  case MSG_FINISHED:
169  //kDebug(7007) << "Finished [this = " << this << "]";
170  d->offset = 0;
171  d->speed_timer.stop();
172  emit finished();
173  break;
174  case MSG_STAT_ENTRY: {
175  UDSEntry entry;
176  stream >> entry;
177  emit statEntry(entry);
178  break;
179  }
180  case MSG_LIST_ENTRIES: {
181  quint32 count;
182  stream >> count;
183 
184  UDSEntryList list;
185  UDSEntry entry;
186  for (uint i = 0; i < count; i++) {
187  stream >> entry;
188  list.append(entry);
189  }
190  emit listEntries(list);
191  break;
192  }
193  case MSG_RESUME: { // From the put job
194  d->offset = readFilesize_t(stream);
195  emit canResume(d->offset);
196  break;
197  }
198  case MSG_CANRESUME: // From the get job
199  d->filesize = d->offset;
200  emit canResume(0); // the arg doesn't matter
201  break;
202  case MSG_ERROR:
203  stream >> i >> str1;
204  kDebug(7007) << "error " << i << " " << str1;
205  emit error(i, str1);
206  break;
207  case MSG_SLAVE_STATUS: {
208  PIDType<sizeof(pid_t)>::PID_t stream_pid;
209  pid_t pid;
210  QByteArray protocol;
211  stream >> stream_pid >> protocol >> str1 >> b;
212  pid = stream_pid;
213  emit slaveStatus(pid, protocol, str1, (b != 0));
214  break;
215  }
216  case MSG_CONNECTED:
217  emit connected();
218  break;
219  case MSG_WRITTEN: {
220  KIO::filesize_t size = readFilesize_t(stream);
221  emit written(size);
222  break;
223  }
224  case INF_TOTAL_SIZE: {
225  KIO::filesize_t size = readFilesize_t(stream);
226  gettimeofday(&d->start_time, 0);
227  d->last_time = 0;
228  d->filesize = d->offset;
229  d->sizes[0] = d->filesize - d->offset;
230  d->times[0] = 0;
231  d->nums = 1;
232  d->speed_timer.start(1000);
233  d->slave_calcs_speed = false;
234  emit totalSize(size);
235  break;
236  }
237  case INF_PROCESSED_SIZE: {
238  KIO::filesize_t size = readFilesize_t(stream);
239  emit processedSize( size );
240  d->filesize = size;
241  break;
242  }
243  case INF_POSITION: {
244  KIO::filesize_t pos = readFilesize_t(stream);
245  emit position(pos);
246  break;
247  }
248  case INF_SPEED:
249  stream >> ul;
250  d->slave_calcs_speed = true;
251  d->speed_timer.stop();
252  emit speed( ul );
253  break;
254  case INF_GETTING_FILE:
255  break;
256  case INF_ERROR_PAGE:
257  emit errorPage();
258  break;
259  case INF_REDIRECTION: {
260  KUrl url;
261  stream >> url;
262  emit redirection( url );
263  break;
264  }
265  case INF_MIME_TYPE:
266  stream >> str1;
267  emit mimeType(str1);
268  if (!d->connection->suspended())
269  d->connection->sendnow(CMD_NONE, QByteArray());
270  break;
271  case INF_WARNING:
272  stream >> str1;
273  emit warning(str1);
274  break;
275  case INF_MESSAGEBOX: {
276  kDebug(7007) << "needs a msg box";
277  QString text, caption, buttonYes, buttonNo, dontAskAgainName;
278  int type;
279  stream >> type >> text >> caption >> buttonYes >> buttonNo;
280  if (stream.atEnd()) {
281  messageBox(type, text, caption, buttonYes, buttonNo);
282  } else {
283  stream >> dontAskAgainName;
284  messageBox(type, text, caption, buttonYes, buttonNo, dontAskAgainName);
285  }
286  break;
287  }
288  case INF_INFOMESSAGE: {
289  QString msg;
290  stream >> msg;
291  emit infoMessage(msg);
292  break;
293  }
294  case INF_META_DATA: {
295  MetaData m;
296  stream >> m;
297  if (m.contains(QLatin1String("ssl_in_use"))) {
298  const QLatin1String ssl_("ssl_");
299  const MetaData constM = m;
300  for (MetaData::ConstIterator it = constM.lowerBound(ssl_); it != constM.constEnd(); ++it) {
301  if (it.key().startsWith(ssl_)) {
302  d->sslMetaData.insert(it.key(), it.value());
303  } else {
304  // we're past the ssl_* entries; remember that QMap is ordered.
305  break;
306  }
307  }
308  }
309  emit metaData(m);
310  break;
311  }
312  case MSG_NET_REQUEST: {
313  QString host;
314  QString slaveid;
315  stream >> host >> slaveid;
316  requestNetwork(host, slaveid);
317  break;
318  }
319  case MSG_NET_DROP: {
320  QString host;
321  QString slaveid;
322  stream >> host >> slaveid;
323  dropNetwork(host, slaveid);
324  break;
325  }
326  case MSG_NEED_SUBURL_DATA: {
327  emit needSubUrlData();
328  break;
329  }
330  case MSG_HOST_INFO_REQ: {
331  QString hostName;
332  stream >> hostName;
333  HostInfo::lookupHost(hostName, this, SLOT(slotHostInfo(QHostInfo)));
334  break;
335  }
336  default:
337  kWarning(7007) << "Slave sends unknown command (" << _cmd << "), dropping slave";
338  return false;
339  }
340  return true;
341 }
342 
343 void SlaveInterface::setOffset( KIO::filesize_t o)
344 {
345  Q_D(SlaveInterface);
346  d->offset = o;
347 }
348 
349 KIO::filesize_t SlaveInterface::offset() const
350 {
351  const Q_D(SlaveInterface);
352  return d->offset;
353 }
354 
355 void SlaveInterface::requestNetwork(const QString &host, const QString &slaveid)
356 {
357  Q_D(SlaveInterface);
358  kDebug(7007) << "requestNetwork " << host << slaveid;
359  QByteArray packedArgs;
360  QDataStream stream( &packedArgs, QIODevice::WriteOnly );
361  stream << true;
362  d->connection->sendnow( INF_NETWORK_STATUS, packedArgs );
363 }
364 
365 void SlaveInterface::dropNetwork(const QString &host, const QString &slaveid)
366 {
367  kDebug(7007) << "dropNetwork " << host << slaveid;
368 }
369 
370 void SlaveInterface::sendResumeAnswer( bool resume )
371 {
372  Q_D(SlaveInterface);
373  kDebug(7007) << "ok for resuming:" << resume;
374  d->connection->sendnow( resume ? CMD_RESUMEANSWER : CMD_NONE, QByteArray() );
375 }
376 
377 void SlaveInterface::messageBox( int type, const QString &text, const QString &_caption,
378  const QString &buttonYes, const QString &buttonNo )
379 {
380  messageBox( type, text, _caption, buttonYes, buttonNo, QString() );
381 }
382 
383 void SlaveInterface::messageBox( int type, const QString &text, const QString &caption,
384  const QString &buttonYes, const QString &buttonNo, const QString &dontAskAgainName )
385 {
386  Q_D(SlaveInterface);
387  kDebug(7007) << "messageBox " << type << " " << text << " - " << caption << " " << dontAskAgainName;
388  QByteArray packedArgs;
389  QDataStream stream( &packedArgs, QIODevice::WriteOnly );
390 
391  QPointer<SlaveInterface> me = this;
392  if (d->connection) d->connection->suspend();
393  int result = d->messageBox( type, text, caption, buttonYes, buttonNo, dontAskAgainName );
394  if ( me && d->connection ) // Don't do anything if deleted meanwhile
395  {
396  d->connection->resume();
397  kDebug(7007) << this << " SlaveInterface result=" << result;
398  stream << result;
399  d->connection->sendnow( CMD_MESSAGEBOXANSWER, packedArgs );
400  }
401 }
402 
403 void SlaveInterface::setWindow (QWidget* window)
404 {
405  Q_D(SlaveInterface);
406  d->parentWindow = window;
407 }
408 
409 QWidget* SlaveInterface::window() const
410 {
411  const Q_D(SlaveInterface);
412  return d->parentWindow;
413 }
414 
415 int SlaveInterfacePrivate::messageBox(int type, const QString &text,
416  const QString &caption, const QString &buttonYes,
417  const QString &buttonNo, const QString &dontAskAgainName)
418 {
419  kDebug() << type << text << "caption=" << caption;
420  int result = -1;
421  KConfig *config = new KConfig("kioslaverc");
422  KMessageBox::setDontShowAskAgainConfig(config);
423 
424  // SMELL: the braindead way to support button icons
425  KGuiItem buttonYesGui, buttonNoGui;
426 
427  if (buttonYes == i18n("&Details"))
428  buttonYesGui = KGuiItem(buttonYes, "help-about");
429  else if (buttonYes == i18n("&Forever"))
430  buttonYesGui = KGuiItem(buttonYes, "flag-green");
431  else
432  buttonYesGui = KGuiItem(buttonYes);
433 
434  if (buttonNo == i18n("Co&ntinue"))
435  buttonNoGui = KGuiItem(buttonNo, "arrow-right");
436  else if (buttonNo == i18n("&Current Session only"))
437  buttonNoGui = KGuiItem(buttonNo, "chronometer");
438  else
439  buttonNoGui = KGuiItem(buttonNo);
440 
441  switch (type) {
442  case KIO::SlaveBase::QuestionYesNo:
443  result = KMessageBox::questionYesNo(
444  parentWindow, text, caption, buttonYesGui,
445  buttonNoGui, dontAskAgainName);
446  break;
447  case KIO::SlaveBase::WarningYesNo:
448  result = KMessageBox::warningYesNo(
449  parentWindow, text, caption, buttonYesGui,
450  buttonNoGui, dontAskAgainName);
451  break;
452  case KIO::SlaveBase::WarningContinueCancel:
453  result = KMessageBox::warningContinueCancel(
454  parentWindow, text, caption, buttonYesGui,
455  KStandardGuiItem::cancel(), dontAskAgainName);
456  break;
457  case KIO::SlaveBase::WarningYesNoCancel:
458  result = KMessageBox::warningYesNoCancel(
459  parentWindow, text, caption, buttonYesGui, buttonNoGui,
460  KStandardGuiItem::cancel(), dontAskAgainName);
461  break;
462  case KIO::SlaveBase::Information:
463  KMessageBox::information(parentWindow, text, caption, dontAskAgainName);
464  result = 1; // whatever
465  break;
466  case KIO::SlaveBase::SSLMessageBox:
467  {
468  KIO::MetaData meta = sslMetaData;
469  QPointer<KSslInfoDialog> kid (new KSslInfoDialog(parentWindow));
470  //### this is boilerplate code and appears in khtml_part.cpp almost unchanged!
471  QStringList sl = meta["ssl_peer_chain"].split('\x01', QString::SkipEmptyParts);
472  QList<QSslCertificate> certChain;
473  bool decodedOk = true;
474  foreach (const QString &s, sl) {
475  certChain.append(QSslCertificate(s.toLatin1())); //or is it toLocal8Bit or whatever?
476  if (certChain.last().isNull()) {
477  decodedOk = false;
478  break;
479  }
480  }
481 
482  if (decodedOk || true/*H4X*/) {
483  kid->setSslInfo(certChain,
484  meta["ssl_peer_ip"],
485  text, // the URL
486  meta["ssl_protocol_version"],
487  meta["ssl_cipher"],
488  meta["ssl_cipher_used_bits"].toInt(),
489  meta["ssl_cipher_bits"].toInt(),
490  KSslInfoDialog::errorsFromString(meta["ssl_cert_errors"]));
491 
492  kDebug(7024) << "Showing SSL Info dialog";
493  kid->exec();
494  kDebug(7024) << "SSL Info dialog closed";
495  } else {
496  KMessageBox::information(0, i18n("The peer SSL certificate chain "
497  "appears to be corrupt."),
498  i18n("SSL"));
499  }
500  // KSslInfoDialog deletes itself (Qt::WA_DeleteOnClose).
501  result = 1; // whatever
502  delete kid;
503  break;
504  }
505  default:
506  kWarning(7024) << "Unknown type" << type;
507  result = 0;
508  break;
509  }
510  KMessageBox::setDontShowAskAgainConfig(0);
511  delete config;
512  return result;
513 }
514 
515 void SlaveInterfacePrivate::slotHostInfo(const QHostInfo& info)
516 {
517  QByteArray data;
518  QDataStream stream(&data, QIODevice::WriteOnly);
519  stream << info.hostName() << info.addresses() << info.error() << info.errorString();
520  connection->send(CMD_HOST_INFO, data);
521 }
522 
523 #include "slaveinterface.moc"
KStandardGuiItem::cancel
KGuiItem cancel()
caption
QString caption()
i18n
QString i18n(const char *text)
KIO::SlaveInterface::setWindow
void setWindow(QWidget *window)
Sets the top level window used as a parent when displaying dialogs.
Definition: slaveinterface.cpp:403
KIO::filesize_t
qulonglong filesize_t
64-bit file size
Definition: global.h:56
KIO::INF_NETWORK_STATUS
Definition: slaveinterface.h:58
ksslinfodialog.h
KIO::INF_INFOMESSAGE
Definition: slaveinterface.h:56
KIO::SlaveInterface::data
void data(const QByteArray &)
KIO::SlaveInterface::position
void position(KIO::filesize_t)
KIO::SlaveInterface::d_ptr
SlaveInterfacePrivate *const d_ptr
Definition: slaveinterface.h:192
KIO::INF_PROCESSED_SIZE
Definition: slaveinterface.h:48
kdebug.h
slaveinterface.h
KSslInfoDialog::errorsFromString
static QList< QList< KSslError::Error > > errorsFromString(const QString &s)
Definition: ksslinfodialog.cpp:232
KIO::INF_META_DATA
Definition: slaveinterface.h:57
KIO::UDSEntry
Universal Directory Service.
Definition: udsentry.h:58
connection.h
KIO::SlaveInterface::needSubUrlData
void needSubUrlData()
KIO::SlaveInterfacePrivate::messageBox
int messageBox(int type, const QString &text, const QString &caption, const QString &buttonYes, const QString &buttonNo, const QString &dontAskAgainName)
Definition: slaveinterface.cpp:415
KMessageBox::warningYesNo
static int warningYesNo(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonYes=KStandardGuiItem::yes(), const KGuiItem &buttonNo=KStandardGuiItem::no(), const QString &dontAskAgainName=QString(), Options options=Options(Notify|Dangerous))
timeout
int timeout
KIO::SlaveInterface
There are two classes that specifies the protocol between application ( KIO::Job) and kioslave...
Definition: slaveinterface.h:98
KIO::SlaveInterfacePrivate::speed_timer
QTimer speed_timer
Definition: slaveinterface_p.h:48
KMessageBox::information
static void information(QWidget *parent, const QString &text, const QString &caption=QString(), const QString &dontShowAgainName=QString(), Options options=Notify)
QWidget
KIO::SlaveInterface::open
void open()
KIO::SlaveInterfacePrivate::slotHostInfo
void slotHostInfo(const QHostInfo &info)
Definition: slaveinterface.cpp:515
KIO::SlaveBase::WarningYesNoCancel
Definition: slavebase.h:248
KIO::SlaveInterface::totalSize
void totalSize(KIO::filesize_t)
KIO::SlaveInterfacePrivate::sslMetaData
MetaData sslMetaData
Definition: slaveinterface_p.h:51
KIO::SlaveInterface::errorPage
void errorPage()
KIO::SlaveInterface::~SlaveInterface
virtual ~SlaveInterface()
Definition: slaveinterface.cpp:50
KMessageBox::setDontShowAskAgainConfig
static void setDontShowAskAgainConfig(KConfig *cfg)
KIO::MSG_CONNECTED
Definition: slaveinterface.h:71
KIO::HostInfo::lookupHost
void lookupHost(const QString &hostName, QObject *receiver, const char *member)
Definition: hostinfo.cpp:240
KIO::SlaveBase::WarningContinueCancel
Definition: slavebase.h:248
quint32
QString
KIO::SlaveInterface::dataReq
void dataReq()
QObject
kDebug
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
klocale.h
KIO::MSG_DATA
Definition: slaveinterface.h:68
KIO::SlaveInterface::setConnection
void setConnection(Connection *connection)
Definition: slaveinterface.cpp:57
KIO::MetaData
MetaData is a simple map of key/value strings.
Definition: global.h:383
KIO::MSG_SLAVE_STATUS
Definition: slaveinterface.h:77
KUrl
config
KSharedConfigPtr config()
KIO::SlaveBase::WarningYesNo
Definition: slavebase.h:248
KIO::SlaveBase::Information
Definition: slavebase.h:248
KIO::MSG_FINISHED
Definition: slaveinterface.h:72
KIO::SlaveInterface::connection
Connection * connection() const
Definition: slaveinterface.cpp:63
KMessageBox::warningYesNoCancel
static int warningYesNoCancel(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonYes=KStandardGuiItem::yes(), const KGuiItem &buttonNo=KStandardGuiItem::no(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
KIO::SlaveInterface::speed
void speed(unsigned long)
KIO::MSG_RESUME
Definition: slaveinterface.h:76
KIO::SlaveInterfacePrivate
Definition: slaveinterface_p.h:32
KIO::MSG_LIST_ENTRIES
Definition: slaveinterface.h:74
KIO::SlaveInterface::finished
void finished()
KIO::SlaveInterface::redirection
void redirection(const KUrl &)
KSslInfoDialog
KDE SSL Information Dialog.
Definition: ksslinfodialog.h:43
KIO::MSG_NET_DROP
Definition: slaveinterface.h:80
KIO::SlaveInterface::offset
KIO::filesize_t offset() const
Definition: slaveinterface.cpp:349
readFilesize_t
static KIO::filesize_t readFilesize_t(QDataStream &stream)
Definition: slaveinterface.cpp:69
KGuiItem
QStringList
KIO::SlaveInterface::SlaveInterface
SlaveInterface(SlaveInterfacePrivate &dd, QObject *parent=0)
Definition: slaveinterface.cpp:44
KIO::MSG_NEED_SUBURL_DATA
Definition: slaveinterface.h:81
KIO::SlaveInterface::written
void written(KIO::filesize_t)
KIO::MSG_STAT_ENTRY
Definition: slaveinterface.h:73
KIO::MSG_NET_REQUEST
Definition: slaveinterface.h:79
KIO::SlaveInterface::sendResumeAnswer
void sendResumeAnswer(bool resume)
Definition: slaveinterface.cpp:370
KIO::SlaveInterface::connected
void connected()
KIO::SlaveBase::SSLMessageBox
Definition: slavebase.h:248
KIO::SlaveInterface::listEntries
void listEntries(const KIO::UDSEntryList &)
KIO::SlaveInterface::statEntry
void statEntry(const KIO::UDSEntry &)
KIO::INF_TOTAL_SIZE
Definition: slaveinterface.h:47
KMessageBox::questionYesNo
static int questionYesNo(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonYes=KStandardGuiItem::yes(), const KGuiItem &buttonNo=KStandardGuiItem::no(), const QString &dontAskAgainName=QString(), Options options=Notify)
KIO::SlaveInterface::window
QWidget * window() const
Returns the top level window used as parent when displaying dialogs.
Definition: slaveinterface.cpp:409
KIO::CMD_RESUMEANSWER
Definition: global.h:175
KIO::INF_WARNING
Definition: slaveinterface.h:53
KIO::CMD_MESSAGEBOXANSWER
Definition: global.h:174
KIO::SlaveInterface::mimeType
void mimeType(const QString &)
KIO::INF_POSITION
Definition: slaveinterface.h:60
KConfig
KIO::SlaveBase::QuestionYesNo
Definition: slavebase.h:248
KIO::INF_SPEED
Definition: slaveinterface.h:49
KIO::INF_MESSAGEBOX
Definition: slaveinterface.h:59
KIO::INF_REDIRECTION
Definition: slaveinterface.h:50
KIO::SlaveInterface::infoMessage
void infoMessage(const QString &)
KIO::SlaveInterface::warning
void warning(const QString &)
KIO::MSG_DATA_REQ
Definition: slaveinterface.h:69
KIO::CMD_NONE
Definition: global.h:156
KIO::SlaveInterface::calcSpeed
void calcSpeed()
Definition: slaveinterface.cpp:91
KIO::SlaveInterface::slaveStatus
void slaveStatus(pid_t, const QByteArray &, const QString &, bool)
KIO::MSG_WRITTEN
Definition: slaveinterface.h:86
KIO::SlaveInterface::error
void error(int, const QString &)
KIO::SlaveInterface::requestNetwork
void requestNetwork(const QString &, const QString &)
Definition: slaveinterface.cpp:355
max_nums
static const unsigned int max_nums
Definition: slaveinterface_p.h:29
kWarning
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
KIO::SlaveInterfacePrivate::parentWindow
QPointer< QWidget > parentWindow
Definition: slaveinterface_p.h:61
qint32
KIO::SlaveInterface::metaData
void metaData(const KIO::MetaData &)
KIO::SlaveInterface::setOffset
void setOffset(KIO::filesize_t offset)
Definition: slaveinterface.cpp:343
KIO::SlaveInterface::processedSize
void processedSize(KIO::filesize_t)
slavebase.h
KIO::SlaveInterfacePrivate::connection
Connection * connection
Definition: slaveinterface_p.h:47
KIO::INF_GETTING_FILE
Definition: slaveinterface.h:54
KIO::MSG_ERROR
Definition: slaveinterface.h:70
KIO::MSG_CANRESUME
Definition: slaveinterface.h:82
hostinfo_p.h
kmessagebox.h
KIO::SlaveInterface::dropNetwork
void dropNetwork(const QString &, const QString &)
Definition: slaveinterface.cpp:365
KIO::SlaveInterface::dispatch
virtual bool dispatch()
Definition: slaveinterface.cpp:76
KIO::MSG_OPENED
Definition: slaveinterface.h:85
KIO::SlaveInterface::messageBox
void messageBox(int type, const QString &text, const QString &caption, const QString &buttonYes, const QString &buttonNo)
Definition: slaveinterface.cpp:377
KIO::CMD_HOST_INFO
Definition: global.h:185
KIO::MSG_HOST_INFO_REQ
Definition: slaveinterface.h:87
KMessageBox::warningContinueCancel
static int warningContinueCancel(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
slaveinterface_p.h
KIO::INF_ERROR_PAGE
Definition: slaveinterface.h:52
QList< UDSEntry >
KIO::SlaveInterface::canResume
void canResume(KIO::filesize_t)
KRecentDirs::list
QStringList list(const QString &fileClass)
Returns a list of directories associated with this file-class.
Definition: krecentdirs.cpp:60
KIO::INF_MIME_TYPE
Definition: slaveinterface.h:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Sat May 31 2014 00:23:04 by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal