All of lore.kernel.org
 help / color / mirror / Atom feed
From: Slavomir Kaslev <kaslevs@vmware.com>
To: Yordan Karadzhov <ykaradzhov@vmware.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	"linux-trace-devel@vger.kernel.org" 
	<linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH 04/12] kernel-shark: Error message if the opening of the session file fails
Date: Fri, 15 Mar 2019 10:23:57 +0000	[thread overview]
Message-ID: <CAE0o1Nt6BCwGSf8pmkZgc1R8Sdf7M+n+MuZ-ArtGt1ZteyJwEw@mail.gmail.com> (raw)
In-Reply-To: <20190314151012.905-5-ykaradzhov@vmware.com>

On Thu, Mar 14, 2019 at 5:11 PM Yordan Karadzhov <ykaradzhov@vmware.com> wrote:
>
> Here we add proper handling of the case when the loading of the
> session description file fails.
>
> Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
> ---
>  kernel-shark/src/KsMainWindow.cpp | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
> index 91e0c9f..44221f6 100644
> --- a/kernel-shark/src/KsMainWindow.cpp
> +++ b/kernel-shark/src/KsMainWindow.cpp
> @@ -1010,7 +1010,16 @@ void KsMainWindow::loadSession(const QString &fileName)
>                 return;
>         }
>
> -       _session.importFromFile(fileName);
> +       if (!_session.importFromFile(fileName)) {
> +               QString text("Unable to open session description file ");
> +
> +               text.append(fileName);
> +               text.append(".\n");

Imo this is cleaner with string interpolation, e.g.

        QString text = QString("Unable to open session description
file %1.\n").arg(fileName);

-- Slavi

> +               _error(text, "loadSessErr1", true, true);
> +
> +               return;
> +       }
> +
>         _session.loadPlugins(kshark_ctx, &_plugins);
>
>         QString dataFile(_session.getDataFile(kshark_ctx));
> --
> 2.19.1
>

  reply	other threads:[~2019-03-15 10:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 15:10 [PATCH 00/12] Various modifications and fixes toward KS 1.0 Yordan Karadzhov
2019-03-14 15:10 ` [PATCH 01/12] kernel-shark: Fix a spelling typo in KsMainWindow class Yordan Karadzhov
2019-03-14 15:10 ` [PATCH 02/12] kernel-shark: Fix a typo in an error message from libkshark-configio Yordan Karadzhov
2019-03-14 15:10 ` [PATCH 03/12] kernel-shark: Make KsSession::importFromFile return status flag Yordan Karadzhov
2019-03-14 15:10 ` [PATCH 04/12] kernel-shark: Error message if the opening of the session file fails Yordan Karadzhov
2019-03-15 10:23   ` Slavomir Kaslev [this message]
2019-03-14 15:10 ` [PATCH 05/12] kernel-shark: Disables automatic quotation for errors in KsMainWindow Yordan Karadzhov
2019-03-14 15:10 ` [PATCH 06/12] kernel-shark: Load Last Session from command line Yordan Karadzhov
2019-03-14 23:47   ` Steven Rostedt
2019-03-15  6:13     ` Yordan Karadzhov (VMware)
2019-03-18 17:44       ` Steven Rostedt
2019-03-14 15:10 ` [PATCH 07/12] kernel-shark: Add destructor for KsGLWidget Yordan Karadzhov
2019-03-14 15:10 ` [PATCH 08/12] kernel-shark: Fix memory leak in KsPlotget::getTaskColorTable() Yordan Karadzhov
2019-03-14 15:10 ` [PATCH 09/12] kernel-shark: Avoid the unnecessary calls of KsGLWidget::loadColors() Yordan Karadzhov
2019-03-14 15:10 ` [PATCH 10/12] kernel-shark: Avoid 0/0 spliter ratio in KsSession Yordan Karadzhov
2019-03-14 15:10 ` [PATCH 11/12] kernel-shark: In model, handle the case when all bins are empty Yordan Karadzhov
2019-03-15 10:21   ` Slavomir Kaslev
2019-03-14 15:10 ` [PATCH 12/12] kernel-shark: In collections, handle the case when the data is small Yordan Karadzhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAE0o1Nt6BCwGSf8pmkZgc1R8Sdf7M+n+MuZ-ArtGt1ZteyJwEw@mail.gmail.com \
    --to=kaslevs@vmware.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=ykaradzhov@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.