[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [plasma-mediacenter] /: Enable C++11
From: Shantanu Tushar <shantanu () kde ! org>
Date: 2014-05-03 7:12:57
Message-ID: E1WgU81-0001ot-UR () scm ! kde ! org
[Download RAW message or body]
Git commit 29115a69f175aceac8804ea1a9be505d8c509fb5 by Shantanu Tushar.
Committed on 03/05/2014 at 07:10.
Pushed by shantanu into branch 'master'.
Enable C++11
M +11 -0 CMakeLists.txt
A +35 -0 libs/test/itemcachetest.cpp [License: LGPL (v2.1+)]
A +31 -0 libs/test/itemcachetest.h [License: LGPL (v2.1+)]
http://commits.kde.org/plasma-mediacenter/29115a69f175aceac8804ea1a9be505d8c509fb5
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 71550fb..0f8138a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,17 @@ project(PlasmaMediaCenter)
option(NO_LINK_TO_PLASMA "Do not link to Plasma at compile-time" OFF)
+include(CheckCXXCompilerFlag)
+CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+if(COMPILER_SUPPORTS_CXX11)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+elseif(COMPILER_SUPPORTS_CXX0X)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+else()
+ message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. \
Please use a different C++ compiler.") +endif()
+
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/cmake)
diff --git a/libs/test/itemcachetest.cpp b/libs/test/itemcachetest.cpp
new file mode 100644
index 0000000..0dc4448
--- /dev/null
+++ b/libs/test/itemcachetest.cpp
@@ -0,0 +1,35 @@
+/***********************************************************************************
+ * Copyright 2014 Shantanu Tushar <shantanu@kde.org> *
+ * *
+ * *
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Lesser General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2.1 of the License, or (at your option) any later version. *
+ * *
+ * This library is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>. *
+ ***********************************************************************************/
+
+#include "itemcachetest.h"
+
+#include <mediacenter/itemcache.h>
+#include <mediacenter/artist.h>
+
+#include <qtest_kde.h>
+
+QTEST_KDEMAIN(ItemCacheTest, NoGUI);
+
+void ItemCacheTest::shouldInsertAndReturnTheSameObjectNextTime()
+{
+ ItemCache<Artist> artists;
+
+ artists.getById("Shaan", true);
+}
+
+#include "itemcachetest.moc"
diff --git a/libs/test/itemcachetest.h b/libs/test/itemcachetest.h
new file mode 100644
index 0000000..e5c8c45
--- /dev/null
+++ b/libs/test/itemcachetest.h
@@ -0,0 +1,31 @@
+/***********************************************************************************
+ * Copyright 2014 Shantanu Tushar <shantanu@kde.org> *
+ * *
+ * *
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Lesser General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2.1 of the License, or (at your option) any later version. *
+ * *
+ * This library is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>. *
+ ***********************************************************************************/
+
+#ifndef ITEMCACHETEST_H
+#define ITEMCACHETEST_H
+
+#include <QObject>
+
+class ItemCacheTest : public QObject
+{
+ Q_OBJECT
+private Q_SLOTS:
+ void shouldInsertAndReturnTheSameObjectNextTime();
+};
+
+#endif // ITEMCACHETEST_H
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic