From patchwork Thu May 2 12:40:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10926731 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E1AD17DF for ; Thu, 2 May 2019 12:40:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C39A28FD9 for ; Thu, 2 May 2019 12:40:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4086128FDD; Thu, 2 May 2019 12:40:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8B7428FD9 for ; Thu, 2 May 2019 12:40:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726380AbfEBMkn (ORCPT ); Thu, 2 May 2019 08:40:43 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42000 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726405AbfEBMkn (ORCPT ); Thu, 2 May 2019 08:40:43 -0400 Received: by mail-wr1-f65.google.com with SMTP id l2so3129982wrb.9 for ; Thu, 02 May 2019 05:40:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=N7ItfzZKOt1nrRaCHb3cf3KeNap2LA1hzeISdKQJswc=; b=JpFWH6xGImItAlBYcAo1fkFWdCvGPruvzkV9EFfWCOheHI2wD7gFbPtqSNzhWoF4vV oa8MpV94QCf2VpLjVvQAOgh9lig5bAjKS7/5FL4UEBfoNDbJTpBue/rHEAjBiUBRPdBM FSNklo6Dw7l/dX7dzs5GQXlrlTzqHTX0bwyln0hDR3+kuv40ACGypqCZfONb7kOP1bH2 HO4t7/pe8rjUuWWb4i/DtS15dD2eQ/hqotOZdM58vHy91o64aKLodsDNy85YkO0rMEJ1 u+JY/VwGutZjH51YbvtchNN6DQ5WBVMps/dtiI5dMj+7GM6OCEkxH9KIRkrhmEVqZBG/ svLw== X-Gm-Message-State: APjAAAV9LMEgBNodODnI8W4SDipleynvxmIg76jHrSDNAxm1g7stMLb4 fKsEvE1HzrNXvC90sMMTmmU= X-Google-Smtp-Source: APXvYqxICNcv5KKQp1NqeqjJwuOsChTgWQP8mJmLCzKHih3ZURPgOKH3owhk8KremBH05x9PRWFHEw== X-Received: by 2002:adf:db05:: with SMTP id s5mr2623511wri.247.1556800842252; Thu, 02 May 2019 05:40:42 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id d11sm7511008wmb.39.2019.05.02.05.40.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 May 2019 05:40:41 -0700 (PDT) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, y.karadz@gmail.com, troyengel@gmail.com, Yordan Karadzhov Subject: [PATCH v2 8/8] kernel-shark: Use XDG compliant path when saving cached data Date: Thu, 2 May 2019 15:40:09 +0300 Message-Id: <20190502124009.32208-9-ykaradzhov@vmware.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190502124009.32208-1-ykaradzhov@vmware.com> References: <20190502124009.32208-1-ykaradzhov@vmware.com> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the QStandardPaths class provided by Qt in order to guarantee that the location of the cached data is XDG compliant. Suggested-by: Troy Engel Signed-off-by: Yordan Karadzhov --- kernel-shark/src/KsMainWindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 5f326f5..bb593bd 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -409,8 +409,10 @@ QString KsMainWindow::_getCacheDir() if (!QDir(dir).exists()) lamMakePath(true); } else { - dir = QString(QDir::homePath()) + - "/.cache/kernelshark"; + auto appCachePath = QStandardPaths::GenericCacheLocation; + dir = QStandardPaths::writableLocation(appCachePath); + dir += "/kernelshark"; + if (!QDir(dir).exists()) lamMakePath(false); }