Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 678656 Details for
Bug 895364
konsole's zmodem file transfer is not working
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch for konsole zmodem
kdebase-4.3.4-konsole-zmodem.patch (text/plain), 31.83 KB, created by
Gris Ge
on 2013-01-15 06:25:01 UTC
(
hide
)
Description:
Patch for konsole zmodem
Filename:
MIME Type:
Creator:
Gris Ge
Created:
2013-01-15 06:25:01 UTC
Size:
31.83 KB
patch
obsolete
>diff -Nur kdebase-4.3.4-org/apps/konsole/desktop/sessionui.rc kdebase-4.3.4/apps/konsole/desktop/sessionui.rc >--- kdebase-4.3.4-org/apps/konsole/desktop/sessionui.rc 2008-05-29 19:18:43.000000000 +0800 >+++ kdebase-4.3.4/apps/konsole/desktop/sessionui.rc 2013-01-15 14:04:47.184187273 +0800 >@@ -12,6 +12,7 @@ > <Action name="rename-session" group="session-edit-operations" /> > <Separator group="session-edit-operations"/> > <Action name="copy-input-to" group="session-edit-operations"/> >+ <Action name="zmodem-upload" group="session-edit-operations"/> > <Separator group="session-edit-operations"/> > <Action name="clear" group="session-edit-operations" /> > <Action name="clear-and-reset" group="session-edit-operations" /> >diff -Nur kdebase-4.3.4-org/apps/konsole/src/main.cpp kdebase-4.3.4/apps/konsole/src/main.cpp >--- kdebase-4.3.4-org/apps/konsole/src/main.cpp 2009-10-30 20:28:19.000000000 +0800 >+++ kdebase-4.3.4/apps/konsole/src/main.cpp 2013-01-15 13:59:12.761276990 +0800 >@@ -45,7 +45,7 @@ > void getDisplayInformation(Display*& display , Visual*& visual , Colormap& colormap); > #endif > >-// fills the KAboutData structure with information about contributors to >+// fills the KAboutData structure with information about contributors to > // Konsole > void fillAboutData(KAboutData& aboutData); > void fillCommandLineOptions(KCmdLineOptions& options); >@@ -55,7 +55,7 @@ > void restoreSession(Application& app); > > // *** >-// Entry point into the Konsole terminal application. >+// Entry point into the Konsole terminal application. > // *** > extern "C" int KDE_EXPORT kdemain(int argc,char** argv) > { >@@ -83,8 +83,8 @@ > { > exit(0); > } >-#ifdef Q_WS_X11 >- if ( useTransparency() ) >+#ifdef Q_WS_X11 >+ if ( useTransparency() ) > { > Display* display = 0; > Visual* visual = 0; >@@ -97,16 +97,16 @@ > return app.exec(); > } > else >-#endif >+#endif > { > Application app; > restoreSession(app); > return app.exec(); >- } >+ } > } > bool forceNewProcess() > { >- // when starting Konsole from a terminal, a new process must be used >+ // when starting Konsole from a terminal, a new process must be used > // so that the current environment is propagated into the shells of the new > // Konsole and any debug output or warnings from Konsole are written to > // the current terminal >@@ -146,7 +146,7 @@ > aboutData.addAuthor(ki18n("Robert Knight"),ki18n("Maintainer"), "robertknight@gmail.com"); > aboutData.addAuthor(ki18n("Lars Doelle"),ki18n("Author"), "lars.doelle@on-line.de"); > aboutData.addCredit(ki18n("Kurt V. Hindenburg"), >- ki18n("Bug fixes and general improvements"), >+ ki18n("Bug fixes and general improvements"), > "kurt.hindenburg@gmail.com"); > aboutData.addCredit(ki18n("Waldo Bastian"), > ki18n("Bug fixes and general improvements"), >@@ -154,6 +154,9 @@ > aboutData.addCredit(ki18n("Stephan Binner"), > ki18n("Bug fixes and general improvements"), > "binner@kde.org"); >+ aboutData.addCredit(ki18n("Thomas Dreibholz"), >+ ki18n("General improvements"), >+ "dreibh@iem.uni-due.de"); > aboutData.addCredit(ki18n("Chris Machemer"), > ki18n("Bug fixes"), > "machey@ceinetworks.com"); >@@ -207,7 +210,7 @@ > } > > // code taken from the Qt 4 graphics dojo examples >-// at http://labs.trolltech.com >+// at http://labs.trolltech.com > #ifdef Q_WS_X11 > void getDisplayInformation(Display*& display , Visual*& visual , Colormap& colormap) > { >@@ -229,7 +232,7 @@ > XVisualInfo *xvi = XGetVisualInfo(display, VisualScreenMask | > VisualDepthMask | > VisualClassMask, &templ, &nvi); >- >+ > for (int i = 0; i < nvi; ++i) { > XRenderPictFormat* format = XRenderFindVisualFormat(display, > xvi[i].visual); >diff -Nur kdebase-4.3.4-org/apps/konsole/src/SessionController.cpp kdebase-4.3.4/apps/konsole/src/SessionController.cpp >--- kdebase-4.3.4-org/apps/konsole/src/SessionController.cpp 2009-10-02 16:18:53.000000000 +0800 >+++ kdebase-4.3.4/apps/konsole/src/SessionController.cpp 2013-01-15 13:56:35.875309877 +0800 >@@ -40,6 +40,8 @@ > #include <kdebug.h> > #include <kcodecaction.h> > #include <kdeversion.h> >+#include <KMessageBox> >+#include <KStandardDirs> > > // Konsole > #include "EditProfileDialog.h" >@@ -133,12 +135,14 @@ > connect( _session , SIGNAL(changeForegroundColorRequest(QColor)) , _view , SLOT(setForegroundColor(QColor)) ); > > // update the title when the session starts >- connect( _session , SIGNAL(started()) , this , SLOT(snapshot()) ); >+ connect( _session , SIGNAL(started()) , this , SLOT(snapshot()) ); > > // listen for output changes to set activity flag > connect( _session->emulation() , SIGNAL(outputChanged()) , this , > SLOT(fireActivity()) ); >- >+ // listen for detection of ZModem transfer >+ connect( _session , SIGNAL(zmodemDetected()) , this , SLOT(zmodemDownload()) ); >+ > // listen for flow control status changes > connect( _session , SIGNAL(flowControlEnabledChanged(bool)) , _view , > SLOT(setFlowControlWarningEnabled(bool)) ); >@@ -158,7 +162,7 @@ > > void SessionController::updateSearchFilter() > { >- if ( _searchFilter ) >+ if ( _searchFilter ) > { > Q_ASSERT( searchBar() && searchBar()->isVisible() ); > >@@ -201,7 +205,7 @@ > { > Q_ASSERT( _session != 0 ); > >- QString title = _session->getDynamicTitle(); >+ QString title = _session->getDynamicTitle(); > title = title.simplified(); > > // crude indicator when the session is broadcasting to others >@@ -428,6 +432,11 @@ > action->setText( i18n("Clear && Reset") ); > action->setIcon( KIcon("edit-clear-history") ); > connect( action , SIGNAL(triggered()) , this , SLOT(clearAndReset()) ); >+ action = collection->addAction("zmodem-upload"); >+ action->setText( i18n( "&ZModem Upload..." ) ); >+ action->setIcon( KIcon("document-open") ); >+ action->setShortcut( QKeySequence(Qt::CTRL+Qt::ALT+Qt::Key_U) ); >+ connect( action , SIGNAL(triggered()) , this , SLOT(zmodemUpload()) ); > > // Monitor > toggleAction = new KToggleAction(i18n("Monitor for &Activity"),this); >@@ -512,7 +521,7 @@ > } > void SessionController::changeProfile(Profile::Ptr profile) > { >- SessionManager::instance()->setSessionProfile(_session,profile); >+ SessionManager::instance()->setSessionProfile(_session,profile); > } > void SessionController::prepareChangeProfileMenu() > { >@@ -556,10 +565,10 @@ > if ( ok ) > { > // renaming changes both the local and remote tab title formats, to save confusion over >- // the tab title not changing if renaming the tab whilst the remote tab title format is >+ // the tab title not changing if renaming the tab whilst the remote tab title format is > // being displayed > // >- // The downside of this approach is that after renaming a tab manually, the ability to >+ // The downside of this approach is that after renaming a tab manually, the ability to > // have separate formats for local and remote activities is lost > _session->setTabTitleFormat(Session::LocalTabTitle,text); > _session->setTabTitleFormat(Session::RemoteTabTitle,text); >@@ -580,10 +589,10 @@ > if (_session->isForegroundProcessActive()) > { > QString title = _session->foregroundProcessName(); >- >+ > // hard coded for now. In future make it possible for the user to specify which programs > // are ignored when considering whether to display a confirmation >- QStringList ignoreList; >+ QStringList ignoreList; > ignoreList << QString(qgetenv("SHELL")).section('/',-1); > if (ignoreList.contains(title)) > return true; >@@ -593,11 +602,11 @@ > question = i18n("A program is currently running in this session." > " Are you sure you want to close it?"); > else >- question = i18n("The program '%1' is currently running in this session." >+ question = i18n("The program '%1' is currently running in this session." > " Are you sure you want to close it?",title); > > int result = KMessageBox::warningYesNo(_view->window(),question,i18n("Confirm Close")); >- return (result == KMessageBox::Yes) ? true : false; >+ return (result == KMessageBox::Yes) ? true : false; > } > return true; > } >@@ -640,10 +649,10 @@ > > CopyInputDialog* dialog = new CopyInputDialog(_view); > dialog->setMasterSession(_session); >- >+ > QSet<Session*> currentGroup = QSet<Session*>::fromList(_copyToGroup->sessions()); > currentGroup.remove(_session); >- >+ > dialog->setChosenSessions(currentGroup); > > QPointer<Session> guard(_session); >@@ -655,7 +664,7 @@ > { > QSet<Session*> newGroup = dialog->chosenSessions(); > newGroup.remove(_session); >- >+ > QSet<Session*> completeGroup = newGroup | currentGroup; > foreach(Session* session, completeGroup) > { >@@ -700,9 +709,9 @@ > if (_listenForScreenWindowUpdates) > return; > >- connect( _view->screenWindow() , SIGNAL(outputChanged()) , this , >+ connect( _view->screenWindow() , SIGNAL(outputChanged()) , this , > SLOT(updateSearchFilter()) ); >- connect( _view->screenWindow() , SIGNAL(scrolled(int)) , this , >+ connect( _view->screenWindow() , SIGNAL(scrolled(int)) , this , > SLOT(updateSearchFilter()) ); > > _listenForScreenWindowUpdates = true; >@@ -721,7 +730,7 @@ > removeSearchFilter(); > > listenForScreenWindowUpdates(); >- >+ > _searchFilter = new RegExpFilter(); > _view->filterChain()->addFilter(_searchFilter); > connect( _searchBar , SIGNAL(searchChanged(const QString&)) , this , >@@ -944,7 +953,7 @@ > // special handling for the "%w" marker which is replaced with the > // window title set by the shell > title.replace("%w",_session->userTitle()); >- // special handling for the "%#" marker which is replaced with the >+ // special handling for the "%#" marker which is replaced with the > // number of the shell > title.replace("%#",QString::number(_session->sessionId())); > >@@ -958,11 +967,11 @@ > { > // needed to make sure the popup menu is available, even if a hosting > // application did not merge our GUI. >- if (!factory()) >+ if (!factory()) > { >- if (!clientBuilder()) >+ if (!clientBuilder()) > setClientBuilder(new KXMLGUIBuilder(_view)); >- >+ > KXMLGUIFactory* factory = new KXMLGUIFactory(clientBuilder(), this); > factory->addClient(this); > } >@@ -1047,6 +1056,56 @@ > else > return true; > } >+void SessionController::zmodemDownload() >+{ >+ QString zmodem = KGlobal::dirs()->findExe("rz"); >+ if(zmodem.isEmpty()) { >+ zmodem = KGlobal::dirs()->findExe("lrz"); >+ } >+ if(!zmodem.isEmpty()) { >+ const QString path = KFileDialog::getExistingDirectory( >+ QString(), _view, >+ i18n("Save ZModem Download to...")); >+ >+ if(!path.isEmpty()) { >+ _session->startZModem(zmodem, path, QStringList()); >+ return; >+ } >+ } >+ else { >+ KMessageBox::error(_view, >+ i18n("<p>A ZModem file transfer attempt has been detected, " >+ "but no suitable ZModem software was found on this system.\n" >+ "<p>You may wish to install the 'rzsz' or 'lrzsz' package.\n")); >+ } >+ _session->cancelZModem(); >+ return; >+} >+ >+void SessionController::zmodemUpload() >+{ >+ if(_session->isZModemBusy()) { >+ KMessageBox::sorry(_view, >+ i18n("<p>The current session already has a ZModem file transfer in progress.")); >+ return; >+ } >+ QString zmodem = KGlobal::dirs()->findExe("sz"); >+ if(zmodem.isEmpty()) { >+ zmodem = KGlobal::dirs()->findExe("lsz"); >+ } >+ if(zmodem.isEmpty()) { >+ KMessageBox::sorry(_view, >+ i18n("<p>No suitable ZModem software was found on this system.\n" >+ "<p>You may wish to install the 'rzsz' or 'lrzsz' package.\n")); >+ return; >+ } >+ >+ QStringList files = KFileDialog::getOpenFileNames(KUrl(), QString(), _view, >+ i18n("Select Files for ZModem Upload")); >+ if(!files.isEmpty()) { >+ _session->startZModem(zmodem, QString::null, files); >+ } >+} > > SessionTask::SessionTask(QObject* parent) > : QObject(parent) >@@ -1319,7 +1378,7 @@ > emulation->writeToStream(&decoder, qMin(endLine,line) , qMax(endLine,line) ); > decoder.end(); > >- // line number search below assumes that the buffer ends with a new-line >+ // line number search below assumes that the buffer ends with a new-line > string.append('\n'); > > pos = -1; >diff -Nur kdebase-4.3.4-org/apps/konsole/src/SessionController.h kdebase-4.3.4/apps/konsole/src/SessionController.h >--- kdebase-4.3.4-org/apps/konsole/src/SessionController.h 2009-10-02 16:18:53.000000000 +0800 >+++ kdebase-4.3.4/apps/konsole/src/SessionController.h 2013-01-15 13:57:27.305333207 +0800 >@@ -1,5 +1,6 @@ > /* > Copyright 2006-2008 by Robert Knight <robertknight@gmail.com> >+ Copyright 2009 by Thomas Dreibholz <dreibh@iem.uni-due.de> > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by >@@ -73,7 +74,7 @@ > * The actions provided by this class are defined in the sessionui.rc XML file. > * > * SessionController monitors the session and provides access to basic information >- * about the session such as title(), icon() and currentDir(). SessionController >+ * about the session such as title(), icon() and currentDir(). SessionController > * provides notifications of activity in the session via the activity() signal. > * > * When the controlled view receives the focus, the focused() signal is emitted >@@ -84,20 +85,20 @@ > class KONSOLEPRIVATE_EXPORT SessionController : public ViewProperties , public KXMLGUIClient > { > Q_OBJECT >- >+ > public: > /** > * Constructs a new SessionController which operates on @p session and @p view. > */ > SessionController(Session* session , TerminalDisplay* view, QObject* parent); > ~SessionController(); >- >+ > /** Returns the session associated with this controller */ > QPointer<Session> session() { return _session; } > /** Returns the view associated with this controller */ > QPointer<TerminalDisplay> view() { return _view; } >- >- /** >+ >+ /** > * Returns true if the controller is valid. > * A valid controller is one which has a non-null session() and view(). > * >@@ -105,22 +106,22 @@ > */ > bool isValid() const; > >- /** >+ /** > * Sets the widget used for searches through the session's output. > * >- * When the user clicks on the "Search Output" menu action the @p searchBar 's >- * show() method will be called. The SessionController will then connect to the search >+ * When the user clicks on the "Search Output" menu action the @p searchBar 's >+ * show() method will be called. The SessionController will then connect to the search > * bar's signals to update the search when the widget's controls are pressed. > */ > void setSearchBar( IncrementalSearchBar* searchBar ); >- /** >+ /** > * see setSearchBar() > */ > IncrementalSearchBar* searchBar() const; > > /** > * Sets the action displayed in the session's context menu to hide or >- * show the menu bar. >+ * show the menu bar. > */ > void setShowMenuAction(QAction* action); > >@@ -139,23 +140,23 @@ > > signals: > /** >- * Emitted when the view associated with the controller is focused. >+ * Emitted when the view associated with the controller is focused. > * This can be used by other classes to plug the controller's actions into a window's >- * menus. >+ * menus. > */ > void focused( SessionController* controller ); > > public slots: > /** > * Issues a command to the session to navigate to the specified URL. >- * This may not succeed if the foreground program does not understand >- * the command sent to it ( 'cd path' for local URLs ) or is not >+ * This may not succeed if the foreground program does not understand >+ * the command sent to it ( 'cd path' for local URLs ) or is not > * responding to input. > * > * openUrl() currently supports urls for local paths and those > * using the 'ssh' protocol ( eg. "ssh://joebloggs@hostname" ) > */ >- void openUrl( const KUrl& url ); >+ void openUrl( const KUrl& url ); > > private slots: > // menu item handlers >@@ -193,7 +194,7 @@ > void searchTextChanged(const QString& text); > void searchCompleted(bool success); > void searchClosed(); // called when the user clicks on the >- // history search bar's close button >+ // history search bar's close button > > void snapshot(); // called periodically as the user types > // to take a snapshot of the state of the >@@ -204,10 +205,12 @@ > void scrollBackOptionsChanged(int mode , int lines, bool saveToCurrentProfile); > void sessionResizeRequest(const QSize& size); > void trackOutput(QKeyEvent* event); // move view to end of current output >- // when a key press occurs in the >+ // when a key press occurs in the > // display area > > void updateSearchFilter(); >+ void zmodemDownload(); >+ void zmodemUpload(); > > /* Returns true if called within a KPart; false if called within Konsole. */ > bool isKonsolePart() const; >@@ -227,7 +230,7 @@ > QPointer<Session> _session; > QPointer<TerminalDisplay> _view; > SessionGroup* _copyToGroup; >- >+ > ProfileList* _profileList; > > KIcon _sessionIcon; >@@ -235,13 +238,13 @@ > int _previousState; > > UrlFilter* _viewUrlFilter; >- RegExpFilter* _searchFilter; >+ RegExpFilter* _searchFilter; > > KAction* _searchToggleAction; > KAction* _findNextAction; > KAction* _findPreviousAction; >- >- >+ >+ > bool _urlFilterUpdateRequired; > > QPointer<IncrementalSearchBar> _searchBar; >@@ -263,7 +266,7 @@ > return !_session.isNull() && !_view.isNull(); > } > >-/** >+/** > * Abstract class representing a task which can be performed on a group of sessions. > * > * Create a new instance of the appropriate sub-class for the task you want to perform and >@@ -279,7 +282,7 @@ > public: > SessionTask(QObject* parent = 0); > >- /** >+ /** > * Sets whether the task automatically deletes itself when the task has been finished. > * Depending on whether the task operates synchronously or asynchronously, the deletion > * may be scheduled immediately after execute() returns or it may happen some time later. >@@ -291,7 +294,7 @@ > /** Adds a new session to the group */ > void addSession(Session* session); > >- /** >+ /** > * Executes the task on each of the sessions in the group. > * The completed() signal is emitted when the task is finished, depending on the specific sub-class > * execute() may be synchronous or asynchronous >@@ -299,8 +302,8 @@ > virtual void execute() = 0; > > signals: >- /** >- * Emitted when the task has completed. >+ /** >+ * Emitted when the task has completed. > * Depending on the task this may occur just before execute() returns, or it > * may occur later > * >@@ -316,7 +319,7 @@ > private: > > bool _autoDelete; >- QList< SessionPtr > _sessions; >+ QList< SessionPtr > _sessions; > }; > > /** >@@ -326,7 +329,7 @@ > class SaveHistoryTask : public SessionTask > { > Q_OBJECT >- >+ > public: > /** Constructs a new task to save session output to URLs */ > SaveHistoryTask(QObject* parent = 0); >@@ -352,7 +355,7 @@ > SessionPtr session; // the session associated with a history save job > int lastLineFetched; // the last line processed in the previous data request > // set this to -1 at the start of the save job >- >+ > TerminalCharacterDecoder* decoder; // decoder used to convert terminal characters > // into output > >@@ -381,8 +384,8 @@ > Q_OBJECT > > public: >- /** >- * This enum describes the strategies available for searching through the >+ /** >+ * This enum describes the strategies available for searching through the > * session's output. > */ > enum SearchDirection >@@ -390,33 +393,33 @@ > /** Searches forwards through the output, starting at the current selection. */ > ForwardsSearch, > /** Searches backwars through the output, starting at the current selection. */ >- BackwardsSearch >+ BackwardsSearch > }; > >- /** >- * Constructs a new search task. >+ /** >+ * Constructs a new search task. > */ > explicit SearchHistoryTask(QObject* parent = 0); > > /** Adds a screen window to the list to search when execute() is called. */ >- void addScreenWindow( Session* session , ScreenWindow* searchWindow); >+ void addScreenWindow( Session* session , ScreenWindow* searchWindow); > > /** Sets the regular expression which is searched for when execute() is called */ > void setRegExp(const QRegExp& regExp); > /** Returns the regular expression which is searched for when execute() is called */ > QRegExp regExp() const; >- >- /** Specifies the direction to search in when execute() is called. */ >+ >+ /** Specifies the direction to search in when execute() is called. */ > void setSearchDirection( SearchDirection direction ); > /** Returns the current search direction. See setSearchDirection(). */ > SearchDirection searchDirection() const; > >- /** >+ /** > * Performs a search through the session's history, starting at the position > * of the current selection, in the direction specified by setSearchDirection(). > * >- * If it finds a match, the ScreenWindow specified in the constructor is >- * scrolled to the position where the match occurred and the selection >+ * If it finds a match, the ScreenWindow specified in the constructor is >+ * scrolled to the position where the match occurred and the selection > * is set to the matching text. execute() then returns immediately. > * > * To continue the search looking for further matches, call execute() again. >@@ -425,7 +428,7 @@ > > private: > typedef QPointer<ScreenWindow> ScreenWindowPtr; >- >+ > void executeOnScreenWindow( SessionPtr session , ScreenWindowPtr window ); > void highlightResult( ScreenWindowPtr window , int position); > >diff -Nur kdebase-4.3.4-org/apps/konsole/src/Session.cpp kdebase-4.3.4/apps/konsole/src/Session.cpp >--- kdebase-4.3.4-org/apps/konsole/src/Session.cpp 2009-05-15 01:26:16.000000000 +0800 >+++ kdebase-4.3.4/apps/konsole/src/Session.cpp 2013-01-15 14:03:59.888240777 +0800 >@@ -3,6 +3,7 @@ > > Copyright 2006-2008 by Robert Knight <robertknight@gmail.com> > Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de> >+ Copyright 2009 by Thomas Dreibholz <dreibh@iem.uni-due.de> > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by >@@ -75,7 +76,7 @@ > , _autoClose(true) > , _wantedClose(false) > , _silenceSeconds(10) >- , _addToUtmp(true) >+ , _addToUtmp(true) > , _flowControl(true) > , _fullScripting(false) > , _sessionId(0) >@@ -105,7 +106,7 @@ > this, SIGNAL( changeTabTextColorRequest( int ) ) ); > connect( _emulation, SIGNAL(profileChangeCommandReceived(const QString&)), > this, SIGNAL( profileChangeCommandReceived(const QString&)) ); >- connect( _emulation, SIGNAL(flowControlKeyPressed(bool)) , this, >+ connect( _emulation, SIGNAL(flowControlKeyPressed(bool)) , this, > SLOT(updateFlowControlState(bool)) ); > > //create new teletype for I/O with shell process >@@ -317,7 +318,7 @@ > if (exec.isEmpty()) > return QString(); > >- // if 'exec' is not specified, fall back to default shell. if that >+ // if 'exec' is not specified, fall back to default shell. if that > // is not set then fall back to /bin/sh > if ( exec.isEmpty() ) > exec = qgetenv("SHELL"); >@@ -327,7 +328,7 @@ > exec = KRun::binaryName(exec, false); > exec = KShell::tildeExpand(exec); > QString pexec = KGlobal::dirs()->findExe(exec); >- if ( pexec.isEmpty() ) >+ if ( pexec.isEmpty() ) > { > kError() << i18n("Could not find binary: ") << exec; > return QString(); >@@ -338,7 +339,7 @@ > > void Session::terminalWarning(const QString& message) > { >- static const QByteArray warningText = i18n("Warning: ").toLocal8Bit(); >+ static const QByteArray warningText = i18n("Warning: ").toLocal8Bit(); > QByteArray messageText = message.toLocal8Bit(); > > static const char* redPenOn = "\033[1m\033[31m"; >@@ -379,7 +380,7 @@ > // if a program was specified via setProgram(), but it couldn't be found, print a warning > if (choice != 0 && choice < CHOICE_COUNT && !_program.isEmpty()) > { >- terminalWarning(i18n("Could not find '%1', starting '%2' instead. Please check your profile settings.",_program,exec)); >+ terminalWarning(i18n("Could not find '%1', starting '%2' instead. Please check your profile settings.",_program,exec)); > } > // if none of the choices are available, print a warning > else if (choice == CHOICE_COUNT) >@@ -387,7 +388,7 @@ > terminalWarning(i18n("Could not find an interactive shell to start.")); > return; > } >- >+ > // if no arguments are specified, fall back to program name > QStringList arguments = _arguments.join(QChar(' ')).isEmpty() ? > QStringList() << exec : _arguments; >@@ -432,7 +433,7 @@ > //set to true if anything is actually changed (eg. old _nameTitle != new _nameTitle ) > bool modified = false; > >- if ((what == IconNameAndWindowTitle) || (what == WindowTitle)) >+ if ((what == IconNameAndWindowTitle) || (what == WindowTitle)) > { > if ( _userTitle != caption ) { > _userTitle = caption; >@@ -448,7 +449,7 @@ > } > } > >- if (what == TextColor || what == BackgroundColor) >+ if (what == TextColor || what == BackgroundColor) > { > QString colorString = caption.section(';',0,0); > QColor color = QColor(colorString); >@@ -461,7 +462,7 @@ > } > } > >- if (what == SessionName) >+ if (what == SessionName) > { > if ( _nameTitle != caption ) { > setTitle(Session::NameRole,caption); >@@ -469,7 +470,7 @@ > } > } > >- if (what == 31) >+ if (what == 31) > { > QString cwd=caption; > cwd=cwd.replace( QRegExp("^~"), QDir::homePath() ); >@@ -477,8 +478,8 @@ > } > > // change icon via \033]32;Icon\007 >- if (what == 32) >- { >+ if (what == 32) >+ { > if ( _iconName != caption ) { > _iconName = caption; > >@@ -486,7 +487,7 @@ > } > } > >- if (what == ProfileChange) >+ if (what == ProfileChange) > { > emit profileChangeCommandReceived(caption); > return; >@@ -524,9 +525,9 @@ > // > //This breaks with the addition of multiple views of a session. The popup should disappear > //when any of the views of the session becomes active >- > >- //FIXME: Make message text for this notification and the activity notification more descriptive. >+ >+ //FIXME: Make message text for this notification and the activity notification more descriptive. > if (_monitorSilence) { > KNotification::event("Silence", i18n("Silence in session '%1'", _nameTitle), QPixmap(), > QApplication::activeWindow(), >@@ -552,12 +553,12 @@ > display->outputSuspended(true); > } > } >- } >+ } > else > { > foreach(TerminalDisplay* display,_views) > display->outputSuspended(false); >- } >+ } > } > void Session::activityStateSet(int state) > { >@@ -655,8 +656,8 @@ > > bool Session::kill(int signal) > { >- int result = ::kill(_shellProcess->pid(),signal); >- >+ int result = ::kill(_shellProcess->pid(),signal); >+ > if ( result == 0 ) > { > _shellProcess->waitForFinished(); >@@ -865,7 +866,7 @@ > KUrl Session::getUrl() > { > QString path; >- >+ > updateSessionProcessInfo(); > if (_sessionProcessInfo->isValid()) > { >@@ -994,7 +995,7 @@ > { > _flowControl = enabled; > >- if (_shellProcess) >+ if (_shellProcess) > _shellProcess->setFlowControlEnabled(_flowControl); > emit flowControlEnabledChanged(enabled); > } >@@ -1031,8 +1032,6 @@ > if (!dir.isEmpty()) > _zmodemProc->setWorkingDirectory(dir); > >- _zmodemProc->start(); >- > connect(_zmodemProc,SIGNAL (readyReadStandardOutput()), > this, SLOT(zmodemReadAndSendBlock())); > connect(_zmodemProc,SIGNAL (readyReadStandardError()), >@@ -1040,14 +1039,14 @@ > connect(_zmodemProc,SIGNAL (finished(int,QProcess::ExitStatus)), > this, SLOT(zmodemFinished())); > >- disconnect( _shellProcess,SIGNAL(block_in(const char*,int)), this, SLOT(onReceiveBlock(const char*,int)) ); >- connect( _shellProcess,SIGNAL(block_in(const char*,int)), this, SLOT(zmodemRcvBlock(const char*,int)) ); >- >+ _zmodemProc->start(); >+ disconnect( _shellProcess,SIGNAL(receivedData(const char*,int)), this, SLOT(onReceiveBlock(const char*,int)) ); >+ connect( _shellProcess,SIGNAL(receivedData(const char*,int)), this, SLOT(zmodemRcvBlock(const char*,int)) ); > _zmodemProgress = new ZModemDialog(QApplication::activeWindow(), false, > i18n("ZModem Progress")); > > connect(_zmodemProgress, SIGNAL(user1Clicked()), >- this, SLOT(zmodemDone())); >+ this, SLOT(zmodemFinished())); > > _zmodemProgress->show(); > } >@@ -1100,15 +1099,18 @@ > > void Session::zmodemFinished() > { >- if (_zmodemProc) >- { >- delete _zmodemProc; >- _zmodemProc = 0; >+ /* zmodemFinished() is called by QProcess's finished() and >+ ZModemDialog's user1Clicked(). Therefore, an invokation by >+ user1Clicked() will recursively invoke this function again >+ when the KProcess is deleted! */ >+ if (_zmodemProc) { >+ KProcess* process = _zmodemProc; >+ _zmodemProc = 0; // Set _zmodemProc to 0 avoid recursive invokations! > _zmodemBusy = false; >+ delete process; // Now, the KProcess may be disposed safely. > >- disconnect( _shellProcess,SIGNAL(block_in(const char*,int)), this ,SLOT(zmodemRcvBlock(const char*,int)) ); >- connect( _shellProcess,SIGNAL(block_in(const char*,int)), this, SLOT(onReceiveBlock(const char*,int)) ); >- >+ disconnect( _shellProcess,SIGNAL(receivedData(const char*,int)), this ,SLOT(zmodemRcvBlock(const char*,int)) ); >+ connect( _shellProcess,SIGNAL(receivedData(const char*,int)), this, SLOT(onReceiveBlock(const char*,int)) ); > _shellProcess->sendData("\030\030\030\030", 4); // Abort > _shellProcess->sendData("\001\013\n", 3); // Try to get prompt back > _zmodemProgress->transferDone(); >@@ -1184,7 +1186,7 @@ > { > QString name; > >- if (updateForegroundProcessInfo()) >+ if (updateForegroundProcessInfo()) > { > bool ok = false; > name = _foregroundProcessInfo->name(&ok); >diff -Nur kdebase-4.3.4-org/apps/konsole/src/ZModemDialog.cpp kdebase-4.3.4/apps/konsole/src/ZModemDialog.cpp >--- kdebase-4.3.4-org/apps/konsole/src/ZModemDialog.cpp 2008-12-11 00:13:08.000000000 +0800 >+++ kdebase-4.3.4/apps/konsole/src/ZModemDialog.cpp 2013-01-15 13:58:09.690777569 +0800 >@@ -16,7 +16,7 @@ > * Boston, MA 02110-1301, USA. > **/ > >-// Own >+// Own > #include "ZModemDialog.h" > > // KDE >@@ -34,8 +34,8 @@ > setButtons( User1|Close ); > setButtonGuiItem( User1, KGuiItem(i18n("&Stop")) ); > >- setDefaultButton( User1 ); >- setEscapeButton(User1); >+ setDefaultButton( Close ); >+ setEscapeButton( User1 ); > > showButtonSeparator( true ); > enableButton(Close, false);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 895364
: 678656