From e3fbd52a84a66656e50fc1cf9dd12143e04d28b4 Mon Sep 17 00:00:00 2001
From: Olivier Langella <Olivier.Langella@moulon.inra.fr>
Date: Thu, 16 Mar 2017 17:18:50 +0100
Subject: [PATCH] wip

---
 .../identificationdatasource.cpp              | 19 ++++++++++++++++---
 .../identificationdatasource.h                |  6 +-----
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/src/core/identification_sources/identificationdatasource.cpp b/src/core/identification_sources/identificationdatasource.cpp
index d3ac59083..afb025013 100644
--- a/src/core/identification_sources/identificationdatasource.cpp
+++ b/src/core/identification_sources/identificationdatasource.cpp
@@ -44,9 +44,22 @@ bool IdentificationDataSource::operator==(const IdentificationDataSource& other)
 
 }
 
-IdentificationDataSourceSp IdentificationDataSource::getInstance(const QString & location) {
-    QFileInfo location_file(location);
-    QString ext = location_file.suffix();
+IdentificationDataSource * IdentificationDataSource::getInstance(const QString & location) {
+
+    std::map< QString, IdentificationDataSource* >::iterator it = _map_identification_data_sources.find(location);
+    if (it != _map_identification_data_sources.end()) {
+        return it->second;
+    }
+    else {
+        QFileInfo location_file(location);
+        QString ext = location_file.suffix();
+        QString sample_name = location_file.baseName();
+        if (ext.toLower() == "xml") {
+            //X!Tandem result file
+	  MsRunIdSp msrunid_sp = 
+
+        }
+    }
 }
 
 const QString & IdentificationDataSource::getResourceName () const {
diff --git a/src/core/identification_sources/identificationdatasource.h b/src/core/identification_sources/identificationdatasource.h
index d067a3cf6..928430919 100644
--- a/src/core/identification_sources/identificationdatasource.h
+++ b/src/core/identification_sources/identificationdatasource.h
@@ -28,14 +28,10 @@
 #include <map>
 
 
-class IdentificationDataSource;
-
-typedef std::shared_ptr<IdentificationDataSource> IdentificationDataSourceSp;
-
 class IdentificationDataSource
 {
 public:
-    static IdentificationDataSourceSp getInstance(const QString & location);
+    static IdentificationDataSource * getInstance(const QString & location);
 
     IdentificationDataSource(pappso::MsRunIdSp & ms_run_sp);
     IdentificationDataSource(const IdentificationDataSource& other);
-- 
GitLab