[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Wed Jul 7 20:18:27 CEST 2004
CVS commit by staikos:
remove dead code, don't instantiate KPrinter when we don't need to
M +10 -31 kst.cpp 1.175
--- kdeextragear-2/kst/kst/kst.cpp #1.174:1.175
@@ -824,11 +824,8 @@ void KstApp::slotFileOpen() {
slotUpdateStatusMsg(i18n("Opening file..."));
- if(doc->saveModified()) {
- QString fileToOpen=
- KFileDialog::getOpenFileName("::<kstfiledir>",
- i18n("*.kst|Kst Plot File "
- "(*.kst)\n*|All Files"),
- this, i18n("Open File"));
- if(!fileToOpen.isEmpty()) {
+ if (doc->saveModified()) {
+ QString fileToOpen = KFileDialog::getOpenFileName("::<kstfiledir>",
+ i18n("*.kst|Kst Plot File (*.kst)\n*|All Files"), this, i18n("Open File"));
+ if (!fileToOpen.isEmpty()) {
doc->openDocument(fileToOpen);
setCaption(doc->getTitle());
@@ -933,11 +930,8 @@ void KstApp::immediatePrintActiveWindowT
void KstApp::slotFilePrint() {
- KMdiIterator<KMdiChildView*> *pIterator;
KstViewWindow *pView;
- KPrinter printer;
- bool bFirstPage = true;
int iNumPages = 0;
- pIterator = createIterator();
+ KMdiIterator<KMdiChildView*> *pIterator = createIterator();
if (pIterator) {
while (pIterator->currentItem()) {
@@ -952,4 +946,6 @@ void KstApp::slotFilePrint() {
if (iNumPages > 0) {
+ KPrinter printer;
+ bool bFirstPage = true;
printer.setPageSize(KPrinter::Letter);
printer.setOrientation(KPrinter::Landscape);
@@ -1015,8 +1011,6 @@ void KstApp::slotFilePrint() {
void KstApp::immediatePrintToFile(const QString& filename) {
- KMdiIterator<KMdiChildView*> *pIterator;
KstViewWindow *pView;
KPrinter printer;
- bool bFirstPage = true;
printer.setPageSize(KPrinter::Letter);
@@ -1026,6 +1020,7 @@ void KstApp::immediatePrintToFile(const
printer.setFromTo(0, 0);
- pIterator = createIterator();
+ KMdiIterator<KMdiChildView*> *pIterator = createIterator();
if (pIterator) {
+ bool bFirstPage = true;
QDateTime dateTime = QDateTime::currentDateTime();
QPainter paint(&printer);
@@ -1106,5 +1101,5 @@ void KstApp::slotViewToolBar() {
slotUpdateStatusMsg(i18n("Toggling toolbar..."));
// turn Toolbar on or off
- if(ToolBarAction->isChecked()) {
+ if (ToolBarAction->isChecked()) {
toolBar("mainToolBar")->show();
} else {
@@ -1157,20 +1152,4 @@ void KstApp::toggleMouseMode() {
-/** Update everything
-void KstApp::slotTimer() {
- KstObject::UpdateType U;
-
- if (PauseAction->isChecked()) { // Paused: don't update
- return;
- }
-
- // pause during mouse zooming
- KstMouseModeType M = view->MouseInfo->getMode();
- if (M == XY_ZOOMBOX || M == Y_ZOOMBOX || M == X_ZOOMBOX) {
- timer->start(KstSettings::globalSettings()->plotUpdateTimer, false);
- return;
- }
-*/
-
void KstApp::tieAll() {
int tied = 0;
More information about the Kst
mailing list