kill evil define usage

svn path=/trunk/kdebase/konqueror/keditbookmarks/; revision=206960
This commit is contained in:
Alexander Kellett 2003-02-15 00:28:59 +00:00
parent 952f08e8fe
commit 60590b09ab

View file

@ -59,14 +59,14 @@
#include "actionsimpl.h"
#define top KEBTopLevel::self()
static KEBTopLevel* top() { return KEBTopLevel::self(); }
void ActionsImpl::slotExpandAll() {
top->setAllOpen(true);
top()->setAllOpen(true);
}
void ActionsImpl::slotCollapseAll() {
top->setAllOpen(false);
top()->setAllOpen(false);
}
ActionsImpl* ActionsImpl::s_self = 0;
@ -78,7 +78,7 @@ ActionsImpl* ActionsImpl::s_self = 0;
void ActionsImpl::slotCut() {
slotCopy();
KMacroCommand *mcmd = CmdGen::self()->deleteItems(i18n("Cut Items"), listview->selectedItems());
top->didCommand(mcmd);
top()->didCommand(mcmd);
}
void ActionsImpl::slotCopy() {
@ -95,7 +95,7 @@ void ActionsImpl::slotPaste() {
i18n("Paste"),
kapp->clipboard()->data(QClipboard::Clipboard),
listview->userAddress());
top->didCommand(mcmd);
top()->didCommand(mcmd);
}
/* ------------------------------------------------------------- */
@ -114,27 +114,27 @@ void ActionsImpl::slotNewFolder() {
CreateCommand *cmd = new CreateCommand(
listview->userAddress(),
dlg.text(), "bookmark_folder", /*open*/ true);
top->addCommand(cmd);
top()->addCommand(cmd);
}
void ActionsImpl::slotNewBookmark() {
CreateCommand * cmd = new CreateCommand(
listview->userAddress(),
QString::null, QString::null, KURL());
top->addCommand(cmd);
top()->addCommand(cmd);
}
void ActionsImpl::slotInsertSeparator() {
CreateCommand * cmd = new CreateCommand(listview->userAddress());
top->addCommand(cmd);
top()->addCommand(cmd);
}
void ActionsImpl::slotImport() {
ImportCommand* import = ImportCommand::performImport(sender()->name()+6, top);
ImportCommand* import = ImportCommand::performImport(sender()->name()+6, top());
if (!import) {
return;
}
top->addCommand(import);
top()->addCommand(import);
KEBListViewItem *item = listview->getItemAtAddress(import->groupAddress());
if (item) {
listview->setCurrent(item);
@ -154,9 +154,9 @@ void ActionsImpl::slotExportMoz() {
/* ------------------------------------------------------------- */
void ActionsImpl::slotShowNS() {
bool shown = top->nsShown();
bool shown = top()->nsShown();
BkManagerAccessor::mgr()->setShowNSBookmarks(shown);
top->setModifiedFlag(true);
top()->setModifiedFlag(true);
}
void ActionsImpl::slotCancelFavIconUpdates() {
@ -196,7 +196,7 @@ void ActionsImpl::slotSearch() {
// also, need to think about limiting size of itr list to <= 1
// or, generically. itr's shouldn't overlap. difficult problem...
bool ok;
QString text = KLineEditDlg::getText("Find string in bookmarks:", "", &ok, top);
QString text = KLineEditDlg::getText("Find string in bookmarks:", "", &ok, top());
SearchItr* itr = new SearchItr(listview->allBookmarks());
itr->setText(text);
SearchItrHolder::self()->insertItr(itr);
@ -210,7 +210,7 @@ void ActionsImpl::slotSort() {
KBookmark bk = listview->selectedBookmark();
Q_ASSERT(bk.isGroup());
SortCommand *cmd = new SortCommand(i18n("Sort Alphabetically"), bk.address());
top->addCommand(cmd);
top()->addCommand(cmd);
}
/* ------------------------------------------------------------- */
@ -219,7 +219,7 @@ void ActionsImpl::slotSort() {
void ActionsImpl::slotDelete() {
KMacroCommand *mcmd = CmdGen::self()->deleteItems(i18n("Delete Items"), listview->selectedItems());
top->didCommand(mcmd);
top()->didCommand(mcmd);
}
void ActionsImpl::slotOpenLink() {
@ -249,12 +249,12 @@ void ActionsImpl::slotSetAsToolbar() {
KBookmark bk = listview->selectedBookmark();
Q_ASSERT(bk.isGroup());
KMacroCommand *mcmd = CmdGen::self()->setAsToolbar(bk);
top->addCommand(mcmd);
top()->addCommand(mcmd);
}
void ActionsImpl::slotChangeIcon() {
KBookmark bk = listview->selectedBookmark();
KIconDialog dlg(top);
KIconDialog dlg(top());
QString newIcon = dlg.selectIcon(KIcon::Small, KIcon::FileSystem);
if (newIcon.isEmpty()) {
return;
@ -263,8 +263,7 @@ void ActionsImpl::slotChangeIcon() {
bk.address(),
EditCommand::Edition("icon", newIcon),
i18n("Icon"));
top->addCommand(cmd);
top()->addCommand(cmd);
}
#undef top
#include "actionsimpl.moc"