[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-i18n-doc
Subject: [PATCH] reduce memory consumption kwalletmanager
From: Dirk Mueller <mueller () kde ! org>
Date: 2003-12-29 15:25:39
[Download RAW message or body]
Hi,
this patch reduces memory consumption by about 0.5MB of unshared data and
improves startup latency when being session-restored by about 0.3s on my
machine. It should be entirely safe.
Problem is, it changes one i18n'ed string.
Please review.
Dirk
["kwalletmanager.diff" (text/x-diff)]
Index: Makefile.am
===================================================================
RCS file: /home/kde/kdeutils/kwallet/Makefile.am,v
retrieving revision 1.13
diff -u -3 -d -p -r1.13 Makefile.am
--- Makefile.am 13 Oct 2003 15:04:43 -0000 1.13
+++ Makefile.am 29 Dec 2003 15:15:29 -0000
@@ -7,7 +7,7 @@ kwalletmanager_SOURCES = walletwidget.ui
kwalletmanager.skel main.cpp kwalletpopup.cpp \
kwalleteditor.cpp kwmapeditor.cpp allyourbase.cpp
kwalletmanager_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-kwalletmanager_LDADD = $(LIB_KHTML) -lkwalletclient
+kwalletmanager_LDADD = $(LIB_KIO) -lkwalletclient
METASOURCES = AUTO
noinst_HEADERS = kwalletmanager.h kwalletpopup.h walletwidget.h kwalleteditor.h\
allyourbase.h kwmapeditor.h
Index: allyourbase.cpp
===================================================================
RCS file: /home/kde/kdeutils/kwallet/allyourbase.cpp,v
retrieving revision 1.12
diff -u -3 -d -p -r1.12 allyourbase.cpp
--- allyourbase.cpp 1 Dec 2003 03:49:59 -0000 1.12
+++ allyourbase.cpp 29 Dec 2003 15:15:30 -0000
@@ -412,7 +412,7 @@ void KWalletIconView::contentsMousePress
}
QDragObject *KWalletIconView::dragObject() {
- KWalletIconDrag *id = new KWalletIconDrag(viewport(), "KWallet Drag");
+ KWalletIconDrag* id = new KWalletIconDrag(viewport(), "KWallet Drag");
QString path = "file:" + KGlobal::dirs()->saveLocation("kwallet");
QPoint pos = _mousePos;
for (QIconViewItem *item = firstItem(); item; item = item->nextItem()) {
Index: kwalleteditor.cpp
===================================================================
RCS file: /home/kde/kdeutils/kwallet/kwalleteditor.cpp,v
retrieving revision 1.35
diff -u -3 -d -p -r1.35 kwalleteditor.cpp
--- kwalleteditor.cpp 10 Nov 2003 19:00:55 -0000 1.35
+++ kwalleteditor.cpp 29 Dec 2003 15:15:32 -0000
@@ -27,7 +27,6 @@
#include <kaction.h>
#include <kapplication.h>
#include <kiconview.h>
-#include <khtml_part.h>
#include <kkeydialog.h>
#include <klineeditdlg.h>
#include <klocale.h>
@@ -53,13 +52,11 @@ KWalletEditor::KWalletEditor(const QStri
: KMainWindow(parent, name), _walletName(wallet), _nonLocal(isPath) {
_ww = new WalletWidget(this, "Wallet Widget");
QVBoxLayout *box = new QVBoxLayout(_ww->_folderDetails);
- _details = new KHTMLPart(_ww->_folderDetails, "Folder Details");
- box->addWidget(_details->widget());
- _details->setJScriptEnabled(false);
- _details->setJavaEnabled(false);
- _details->setMetaRefreshEnabled(false);
- _details->setPluginsEnabled(false);
- _details->setOnlyLocalReferences(true);
+ _details = new QLabel(_ww->_folderDetails, "Folder Details");
+ _details->setBackgroundMode(PaletteBase);
+ _details->setAlignment((_details->alignment() & ~AlignVertical_Mask)|AlignTop);
+ _details->setFrameStyle(QFrame::Sunken | QFrame::Panel);
+ box->addWidget(_details);
box = new QVBoxLayout(_ww->_entryListFrame);
_entryList = new KWalletEntryList(_ww->_entryListFrame, "Wallet Entry List");
@@ -369,9 +366,7 @@ void KWalletEditor::folderSelectionChang
updateDetails();
updateEntries();
} else {
- _details->begin();
- _details->write(QString::null);
- _details->end();
+ _details->setText(QString::null);
while (_passItems->firstChild()) {
delete _passItems->firstChild();
}
@@ -395,22 +390,19 @@ void KWalletEditor::folderSelectionChang
void KWalletEditor::updateDetails() {
- static const QString page = i18n("<html><body>"
- "<div style=\"margin-left: 3%; margin-right: 3%; background-color: #99ccff\">"
+ static const QString page = i18n("<qt><br /><center>"
+ "<table width=\"90%\"><tr><td bgcolor=\"#99ccff\">"
"<font size=\"+2\"> Folder:</font>"
- " <font size=\"+1\"><b>%1</b></font>"
- "</div>"
- "<br/>"
+ " <font size=\"+1\"><b>%1</b>"
+ "</font></td></tr></table></center>"
"<ul>"
"<li>%2</li>"
"</ul>"
- "<br/></body></html>");
+ "</qt>");
- _details->begin();
- _details->write(page
+ _details->setText(page
.arg(_folderView->currentItem()->text())
.arg(i18n("Contains one item.", "Contains %n items." ,_entries.count())));
- _details->end();
}
Index: kwalleteditor.h
===================================================================
RCS file: /home/kde/kdeutils/kwallet/kwalleteditor.h,v
retrieving revision 1.15
diff -u -3 -d -p -r1.15 kwalleteditor.h
--- kwalleteditor.h 15 Sep 2003 05:36:22 -0000 1.15
+++ kwalleteditor.h 29 Dec 2003 15:15:32 -0000
@@ -29,7 +29,6 @@ class KAction;
class QIconViewItem;
class QListViewItem;
class QCheckBox;
-class KHTMLPart;
class KWalletFolderIconView;
class KWalletEntryList;
class KWMapEditor;
@@ -91,7 +90,7 @@ class KWalletEditor : public KMainWindow
KWalletEntryList *_entryList;
KAction *_newFolderAction, *_deleteFolderAction;
KAction *_passwordAction;
- KHTMLPart *_details;
+ QLabel*_details;
QStringList _entries;
QListViewItem *_passItems, *_mapItems, *_binaryItems, *_unknownItems;
QMap<QString,QString> _currentMap; // save memory by storing
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic