[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    benchmark (Re: koffice/libs/main)
From:       Thomas Zander <zander () kde ! org>
Date:       2010-06-16 19:35:45
Message-ID: 201006162135.46208.zander () kde ! org
[Download RAW message or body]

This commit adds a feature of benchmark but it confuses me as it doesn't 
actually benchmark anything. It just quits allowing external benchmarking to 
happen. Since the benchmarking is not done by this feature, is it not incorrect 
named then?

I spotted some issues while reading the patch;
* if the user passes more than one document we load all of them.
* the shell is still 'shown', is that needed?
* you per definition return false by using a mutually exclusive variable, which 
looks wrong to me as returning false indicates failure.

I'll commit fixes for most of these shortly, but the naming is still open. I 
think we should find a more accurate name since its probably not useful
to do any actual benchmarking in KOffice.
So what about "only-load" ?
 

On Sunday 13. June 2010 11.38.57 Thorsten Zachmann wrote:
> SVN commit 1137506 by zachmann:
> 
> o add option to benchmark loading speed.
>   The application stops after the document is loaded.
> 
> 
>  M  +9 -1      KoApplication.cpp
> 
> 
> --- trunk/koffice/libs/main/KoApplication.cpp #1137505:1137506
> @@ -75,6 +75,7 @@
>      options.add("dpi <dpiX,dpiY>", ki18n("Override display DPI"));
>      options.add("export-pdf", ki18n("Only export to PDF and exit"));
>      options.add("export-filename <filename>", ki18n("Filename for
> export-pdf")); +    options.add("benchmark-loading", ki18n("just load the
> file and then exit")); KCmdLineArgs::addCmdLineOptions(options,
> ki18n("KOffice"), "koffice", "kde"); return true;
>  }
> @@ -155,6 +156,7 @@
>          const bool exportAsPdf = koargs->isSet("export-pdf");
>          QString pdfFileName = koargs->getOption("export-filename");
>          const bool doTemplate = koargs->isSet("template");
> +        const bool benchmarkLoading = koargs->isSet("benchmark-loading");
>          koargs->clear();
> 
>          // Loop through arguments
> @@ -214,7 +216,10 @@
>                      // now try to load
>                  }
>                  else if (shell->openDocument(doc, args->url(i))) {
> -                    if (print) {
> +                    if (benchmarkLoading) {
> +                        shell->slotFileQuit();
> +                    }
> +                    else if (print) {
>                          shell->slotFilePrint();
>                          // delete shell; done by ~KoDocument
>                          nPrinted++;
> @@ -235,6 +240,9 @@
>                  }
>              }
>          }
> +        if (benchmarkLoading) {
> +            return nPrinted > 0;
> +        }
>          if (print || exportAsPdf)
>              return nPrinted > 0;
>          if (n == 0) // no doc, e.g. all URLs were malformed

-- 
Thomas Zander
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic