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

KIO

  • sources
  • kde-4.14
  • kdelibs
  • kio
  • kio
krun_p.h
Go to the documentation of this file.
1 // -*- mode: c++; c-basic-offset: 2 -*-
2 /* This file is part of the KDE project
3  Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
4  Copyright (C) 2006 David Faure <faure@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef KRUN_P_H
23 #define KRUN_P_H
24 
25 #include <QtCore/QObject>
26 #include <QtCore/QPointer>
27 
28 #include "kprocess.h"
29 #include "kstartupinfo.h"
30 
37 class KProcessRunner : public QObject
38 {
39  Q_OBJECT
40 
41  public:
42 
43 #ifndef Q_WS_X11
44  static int run(KProcess *, const QString & executable);
45 #else
46  static int run(KProcess *, const QString & executable, const KStartupInfoId& id);
47 #endif
48 
49  virtual ~KProcessRunner();
50 
51  int pid() const;
52 
53  protected Q_SLOTS:
54 
55  void slotProcessExited(int, QProcess::ExitStatus);
56 
57  private:
58 #ifndef Q_WS_X11
59  KProcessRunner(KProcess *, const QString & binName);
60 #else
61  KProcessRunner(KProcess *, const QString & binName, const KStartupInfoId& id);
62 #endif
63 
64  void terminateStartupNotification();
65 
66  KProcess *process;
67  QString m_executable; // can be a full path
68  KStartupInfoId id;
69  int m_pid;
70 
71  Q_DISABLE_COPY(KProcessRunner)
72 };
73 
77 class KRun::KRunPrivate
78 {
79 public:
80  KRunPrivate(KRun *parent);
81 
82  void init (const KUrl& url, QWidget* window, mode_t mode,
83  bool isLocalFile, bool showProgressInfo, const QByteArray& asn);
84 
85  // This helper method makes debugging easier: a single breakpoint for all
86  // the code paths that start the timer - at least from KRun itself.
87  // TODO: add public method startTimer() and deprecate timer() accessor,
88  // starting is the only valid use of the timer in subclasses (BrowserRun, KHTMLRun and KonqRun)
89  void startTimer();
90 
91 #ifdef Q_WS_WIN
92  static bool displayNativeOpenWithDialog( const KUrl::List& lst, QWidget* window, bool tempFiles,
93  const QString& suggestedFileName, const QByteArray& asn );
94 #endif
95  bool runExecutable(const QString& _exec);
96 
97  KRun *q;
98  bool m_showingDialog;
99  bool m_runExecutables;
100 
101  QString m_preferredService;
102  QString m_externalBrowser;
103  QString m_localPath;
104  QString m_suggestedFileName;
105  QPointer <QWidget> m_window;
106  QByteArray m_asn;
107  KUrl m_strURL;
108  bool m_bFault;
109  bool m_bAutoDelete;
110  bool m_bProgressInfo;
111  bool m_bFinished;
112  KIO::Job * m_job;
113  QTimer m_timer;
114 
119  bool m_bScanFile;
120  bool m_bIsDirectory;
121 
126  bool m_bInit;
127 
128  bool m_bIsLocalFile;
129  mode_t m_mode;
130 };
131 
132 #endif // KRUN_P_H
KRun::KRunPrivate::m_bInit
bool m_bInit
Used to indicate that the next action is to initialize.
Definition: krun_p.h:126
QWidget
KRun::KRunPrivate::startTimer
void startTimer()
Definition: krun.cpp:93
KProcess
KRun::KRunPrivate::m_runExecutables
bool m_runExecutables
Definition: krun_p.h:99
QByteArray
KRun::KRunPrivate::m_bProgressInfo
bool m_bProgressInfo
Definition: krun_p.h:110
KProcessRunner::slotProcessExited
void slotProcessExited(int, QProcess::ExitStatus)
Definition: krun.cpp:1789
QPointer< QWidget >
KRun::KRunPrivate::m_window
QPointer< QWidget > m_window
Definition: krun_p.h:105
KRun::url
KUrl url() const
Returns the url.
Definition: krun.cpp:1620
KStartupInfoId
kstartupinfo.h
KRun::KRunPrivate::m_bIsDirectory
bool m_bIsDirectory
Definition: krun_p.h:120
KRun::KRunPrivate::m_strURL
KUrl m_strURL
Definition: krun_p.h:107
KUrl
KRun
To open files with their associated applications in KDE, use KRun.
Definition: krun.h:59
KProcessRunner::pid
int pid() const
Definition: krun.cpp:1770
KRun::KRunPrivate::displayNativeOpenWithDialog
static bool displayNativeOpenWithDialog(const KUrl::List &lst, QWidget *window, bool tempFiles, const QString &suggestedFileName, const QByteArray &asn)
Definition: krun_win.cpp:82
kprocess.h
KRun::KRunPrivate::q
KRun * q
Definition: krun_p.h:97
KRun::KRunPrivate::m_localPath
QString m_localPath
Definition: krun_p.h:103
QTimer
QObject
KRun::window
QWidget * window() const
Associated window, as passed to the constructor.
Definition: krun.cpp:1552
KRun::KRunPrivate::m_preferredService
QString m_preferredService
Definition: krun_p.h:101
KRun::KRunPrivate::KRunPrivate
KRunPrivate(KRun *parent)
Definition: krun.cpp:87
KProcessRunner::~KProcessRunner
virtual ~KProcessRunner()
Definition: krun.cpp:1765
KRun::mode
mode_t mode() const
Returns the file mode.
Definition: krun.cpp:1719
KProcessRunner::run
static int run(KProcess *, const QString &executable, const KStartupInfoId &id)
Definition: krun.cpp:1732
QString
KRun::KRunPrivate::m_timer
QTimer m_timer
Definition: krun_p.h:113
KProcessRunner
Definition: krun_p.h:37
KRun::KRunPrivate::m_bIsLocalFile
bool m_bIsLocalFile
Definition: krun_p.h:128
KRun::KRunPrivate::m_bFinished
bool m_bFinished
Definition: krun_p.h:111
KUrl::List
KRun::KRunPrivate::m_externalBrowser
QString m_externalBrowser
Definition: krun_p.h:102
KRun::KRunPrivate::m_bScanFile
bool m_bScanFile
Used to indicate that the next action is to scan the file.
Definition: krun_p.h:119
KRun::isLocalFile
bool isLocalFile() const
Returns whether it is a local file.
Definition: krun.cpp:1709
KRun::suggestedFileName
QString suggestedFileName() const
Suggested file name given by the server (e.g.
Definition: krun.cpp:1602
KRun::KRunPrivate::m_showingDialog
bool m_showingDialog
Definition: krun_p.h:98
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:94
KRun::KRunPrivate::m_mode
mode_t m_mode
Definition: krun_p.h:129
KRun::KRunPrivate::m_bAutoDelete
bool m_bAutoDelete
Definition: krun_p.h:109
KRun::KRunPrivate::runExecutable
bool runExecutable(const QString &_exec)
Definition: krun.cpp:1265
KRun::KRunPrivate::m_bFault
bool m_bFault
Definition: krun_p.h:108
QObject::parent
QObject * parent() const
KRun::KRunPrivate::init
void init(const KUrl &url, QWidget *window, mode_t mode, bool isLocalFile, bool showProgressInfo, const QByteArray &asn)
Definition: krun.cpp:1110
KRun::KRunPrivate::m_asn
QByteArray m_asn
Definition: krun_p.h:106
KRun::KRunPrivate::m_suggestedFileName
QString m_suggestedFileName
Definition: krun_p.h:104
KRun::KRunPrivate::m_job
KIO::Job * m_job
Definition: krun_p.h:112
KRun::KRunPrivate
Definition: krun_p.h:77
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:53 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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