[rkward-cvs] SF.net SVN: rkward: [2087] branches/KDE4_port
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Wed Oct 17 15:20:51 UTC 2007
Revision: 2087
http://rkward.svn.sourceforge.net/rkward/?rev=2087&view=rev
Author: tfry
Date: 2007-10-17 08:20:51 -0700 (Wed, 17 Oct 2007)
Log Message:
-----------
Fix display of working dir in statusbar and some (but not all) crashes for filename completion in the console
Modified Paths:
--------------
branches/KDE4_port/TODO_KDE4
branches/KDE4_port/rkward/rkconsole.cpp
branches/KDE4_port/rkward/rkward.cpp
branches/KDE4_port/rkward/rkward.h
Modified: branches/KDE4_port/TODO_KDE4
===================================================================
--- branches/KDE4_port/TODO_KDE4 2007-10-16 15:26:31 UTC (rev 2086)
+++ branches/KDE4_port/TODO_KDE4 2007-10-17 15:20:51 UTC (rev 2087)
@@ -34,6 +34,7 @@
rkward
- does closing windows work
- does updating captions work (when switching windows / window url changes)?
+ - status bar does not show working dir
output window
- does it reload all changed images?
@@ -83,6 +84,7 @@
rkconsole:
- check whether all selection, editing, navigating really works as expected
+ - is tab completion for file names still crashy?
rkcommandlog:
- does the RMB-menu work?
Modified: branches/KDE4_port/rkward/rkconsole.cpp
===================================================================
--- branches/KDE4_port/rkward/rkconsole.cpp 2007-10-16 15:26:31 UTC (rev 2086)
+++ branches/KDE4_port/rkward/rkconsole.cpp 2007-10-17 15:20:51 UTC (rev 2087)
@@ -380,8 +380,10 @@
do_file_completion = true;
// however, some characters around quotes signify it's probably not really filename string
- char char_before_quote = current_line.at (quote_start - 1).toLatin1();
- char char_after_quote = current_line.at (quote_start + 1).toLatin1();
+ char char_before_quote = ' ';
+ if (quote_start > 1) char_before_quote = current_line.at (quote_start - 1).toLatin1();
+ char char_after_quote = ' ';
+ if (quote_start <= (current_line.length() - 2)) char_after_quote = current_line.at (quote_start + 1).toLatin1();
// these signifiy it might be an object in a list somewhere, e.g. my.data$"varname"
if ((char_before_quote == '[') || (char_before_quote == '$') || (char_before_quote == ':')) do_file_completion = false;
// these indicate, the quote has likely ended rather that started
Modified: branches/KDE4_port/rkward/rkward.cpp
===================================================================
--- branches/KDE4_port/rkward/rkward.cpp 2007-10-16 15:26:31 UTC (rev 2086)
+++ branches/KDE4_port/rkward/rkward.cpp 2007-10-17 15:20:51 UTC (rev 2087)
@@ -48,6 +48,7 @@
#include <kxmlguifactory.h>
#include <kactioncollection.h>
#include <krecentfilesaction.h>
+#include <khbox.h>
// application specific includes
#include "rkward.h"
@@ -428,21 +429,16 @@
void RKWardMainWindow::initStatusBar () {
RK_TRACE (APP);
- // why do we need this QHBox, when the statusbar already does horizontal layout?
- // Well, apparently the stretch factors do not survive a hide/show, so we need some way to work around this
- Q3HBox *statusbar_hbox = new Q3HBox (statusBar ());
- statusbar_action = new KSqueezedTextLabel (statusbar_hbox);
- statusbar_action->hide ();
- statusbar_ready = new QLabel (i18n ("Ready."), statusbar_hbox);
- statusbar_cwd = new KSqueezedTextLabel (statusbar_hbox);
+ statusbar_ready = new QLabel (i18n ("Ready."), statusBar ());
+ statusBar ()->addWidget (statusbar_ready);
+ statusbar_cwd = new KSqueezedTextLabel (statusBar ());
statusbar_cwd->setAlignment (Qt::AlignRight);
- statusbar_hbox->setStretchFactor (statusbar_cwd, 1);
+ statusBar ()->addWidget (statusbar_cwd, 10);
updateCWD ();
- statusBar ()->addWidget (statusbar_hbox, 1);
statusbar_r_status = new QLabel (statusBar ());
statusbar_r_status->setFixedHeight (statusBar ()->fontMetrics ().height () + 2);
- statusBar ()->addWidget (statusbar_r_status, 0, true);
+ statusBar ()->addPermanentWidget (statusbar_r_status, 0);
setRStatus (Starting);
connect (actionCollection (), SIGNAL (actionStatusText (const QString &)), this, SLOT (slotSetStatusBarText (const QString &)));
@@ -615,17 +611,13 @@
void RKWardMainWindow::slotSetStatusBarText (const QString &text) {
RK_TRACE (APP);
+//KDE4: still needed?
QString ntext = text.trimmed ();
ntext.replace ("<qt>", ""); // WORKAROUND: what the ?!? is going on? The KTHMLPart seems to post such messages.
if (ntext.isEmpty ()) {
- statusbar_action->hide ();
- statusbar_ready->show ();
- statusbar_cwd->show ();
+ statusBar ()->clearMessage ();
} else {
- statusbar_action->show ();
- statusbar_ready->hide ();
- statusbar_cwd->hide ();
- statusbar_action->setText (ntext);
+ statusBar ()->showMessage (ntext);
}
}
Modified: branches/KDE4_port/rkward/rkward.h
===================================================================
--- branches/KDE4_port/rkward/rkward.h 2007-10-16 15:26:31 UTC (rev 2086)
+++ branches/KDE4_port/rkward/rkward.h 2007-10-17 15:20:51 UTC (rev 2087)
@@ -62,9 +62,9 @@
class RKCommandEditorWindow;
class KMdiToolViewAccessor;
class RKMDIWindow;
-class Q3HBox;
class RKTopLevelWindowGUI;
class KRecentFilesAction;
+class KSqueezedTextLabel;
struct RKWardStartupOptions {
KUrl *initial_url; /**< The workspace file to load on startup. If 0, show a dialog asking what to do. **/
@@ -172,9 +172,8 @@
void partRemoved (KParts::Part *part);
private:
QLabel* statusbar_r_status;
- QLabel* statusbar_cwd;
+ KSqueezedTextLabel* statusbar_cwd;
QLabel* statusbar_ready;
- QLabel* statusbar_action;
KParts::PartManager *part_manager;
// KAction pointers to enable/disable actions
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list