Remove dead code
authorHannah von Reth <hannah.vonreth@owncloud.com>
Mon, 17 Aug 2020 19:30:46 +0000 (21:30 +0200)
committerMichael Schuster <michael@schuster.ms>
Thu, 20 Aug 2020 16:50:05 +0000 (18:50 +0200)
Signed-off-by: Michael Schuster <michael@schuster.ms>
shell_integration/windows/OCOverlays/OCOverlay.cpp
shell_integration/windows/OCUtil/CMakeLists.txt
shell_integration/windows/OCUtil/FileUtil.cpp [deleted file]
shell_integration/windows/OCUtil/FileUtil.h [deleted file]
shell_integration/windows/OCUtil/RegistryUtil.cpp [deleted file]
shell_integration/windows/OCUtil/RegistryUtil.h [deleted file]

index cd36d605d06e4e7d2514a261620140c1c65a4dab..985faec54cadb195efde5c23aed1c3372fef275c 100644 (file)
@@ -15,7 +15,6 @@
 #include "OCOverlay.h"
 
 #include "OCOverlayFactory.h"
-#include "RegistryUtil.h"
 #include "StringUtil.h"
 
 #include "UtilConstants.h"
index cf31dd3da080549f729223240521c68ce7caaace..13a9f6f53891bca0ce9a46784f7b7679a96bfff1 100644 (file)
@@ -1,7 +1,5 @@
 add_library(OCUtil STATIC
     CommunicationSocket.cpp
-    FileUtil.cpp
-    RegistryUtil.cpp
     RemotePathChecker.cpp
     StringUtil.cpp
     OCUtil.rc
diff --git a/shell_integration/windows/OCUtil/FileUtil.cpp b/shell_integration/windows/OCUtil/FileUtil.cpp
deleted file mode 100644 (file)
index 6230e17..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
- *
- * 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.
- */
-
-#include "FileUtil.h"
-#include "RegistryUtil.h"
-#include "UtilConstants.h"
-
-using namespace std;
-
-bool FileUtil::IsChildFile(const wchar_t* rootFolder, vector<wstring>* files)
-{
-    for(vector<wstring>::iterator it = files->begin(); it != files->end(); it++)
-    {
-        wstring file = *it;
-
-        size_t found = file.find(rootFolder);
-
-        if(found != string::npos)
-        {
-            return true;    
-        }
-    }
-
-    return false;
-}
-
-bool FileUtil::IsChildFile(const wchar_t* rootFolder, const wchar_t* file)
-{
-    const wstring f(file);
-
-    size_t found = f.find(rootFolder);
-
-    if(found != string::npos)
-    {
-        return true;    
-    }
-    
-    return false;
-}
-
-bool FileUtil::IsChildFileOfRoot(std::vector<std::wstring>* files) 
-{
-    wstring* rootFolder = new wstring();
-    bool needed = false;
-
-    if(RegistryUtil::ReadRegistry(REGISTRY_ROOT_KEY, REGISTRY_FILTER_FOLDER, rootFolder))
-    {
-        if(IsChildFile(rootFolder->c_str(), files))
-        {
-            needed = true;
-        }
-    }
-
-    delete rootFolder;
-    return needed;
-}
-
-bool FileUtil::IsChildFileOfRoot(const wchar_t* filePath)
-{
-    wstring* rootFolder = new wstring();
-    bool needed = false;
-    
-    if(RegistryUtil::ReadRegistry(REGISTRY_ROOT_KEY, REGISTRY_FILTER_FOLDER, rootFolder))
-    {
-        if(FileUtil::IsChildFile(rootFolder->c_str(), filePath))
-        {
-            needed = true;
-        }
-    }
-
-    delete rootFolder;
-    return needed;
-}
diff --git a/shell_integration/windows/OCUtil/FileUtil.h b/shell_integration/windows/OCUtil/FileUtil.h
deleted file mode 100644 (file)
index 35a5be0..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
- *
- * 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.
- */
-
-#ifndef FILEUTIL_H
-#define FILEUTIL_H
-
-#pragma once
-
-#pragma warning (disable : 4251)
-
-#include <string>
-#include <vector>
-
-class __declspec(dllexport) FileUtil
-{
-public:
-    FileUtil();
-
-    ~FileUtil();
-
-    static bool IsChildFile(const wchar_t*, std::vector<std::wstring>*);
-    static bool IsChildFile(const wchar_t*, const wchar_t*);
-    static bool IsChildFileOfRoot(std::vector<std::wstring>*);
-    static bool IsChildFileOfRoot(const wchar_t*);
-
-private:    
-};
-
-#endif
\ No newline at end of file
diff --git a/shell_integration/windows/OCUtil/RegistryUtil.cpp b/shell_integration/windows/OCUtil/RegistryUtil.cpp
deleted file mode 100644 (file)
index b5be8f2..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
- *
- * 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.
- */
-
-#include <windows.h>
-
-#include "RegistryUtil.h"
-
-using namespace std;
-
-#define SIZE 4096
-
-bool RegistryUtil::ReadRegistry(const wchar_t* key, const wchar_t* name, int* result)
-{
-    wstring* strResult = new wstring();
-
-    if(!ReadRegistry(key, name, strResult))
-    {
-        return false;
-    }
-
-    *result = stoi( strResult->c_str() );
-
-    return true;
-}
-
-bool RegistryUtil::ReadRegistry(const wchar_t* key, const wchar_t* name, wstring* result)
-{
-    HRESULT hResult;
-
-    HKEY rootKey = nullptr;
-
-    hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CURRENT_USER, (LPCWSTR)key, 0, KEY_READ, &rootKey));
-
-    if(!SUCCEEDED(hResult))
-    {
-        return false;
-    }
-
-    wchar_t value[SIZE];
-    DWORD value_length = SIZE;
-
-    hResult = RegQueryValueEx(rootKey, (LPCWSTR)name, nullptr, nullptr, (LPBYTE)value, &value_length );
-
-    if(!SUCCEEDED(hResult))
-    {
-        return false;
-    }
-
-    result->append(value);
-
-    HRESULT hResult2 = RegCloseKey(rootKey);
-
-    if (!SUCCEEDED(hResult2))
-    {
-        return false;
-    }
-
-    return true;
-}
diff --git a/shell_integration/windows/OCUtil/RegistryUtil.h b/shell_integration/windows/OCUtil/RegistryUtil.h
deleted file mode 100644 (file)
index 9cc40a9..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
- *
- * 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.
- */
-
-#ifndef REGISTRYUTIL_H
-#define REGISTRYUTIL_H
-
-#pragma once
-
-#pragma warning (disable : 4251)
-
-#include <string>
-
-class __declspec(dllexport) RegistryUtil
-{
-public:
-    RegistryUtil();
-
-    ~RegistryUtil();
-
-    static bool ReadRegistry(const wchar_t*,  const wchar_t*, int*);
-    static bool ReadRegistry(const wchar_t*,  const wchar_t*, std::wstring*);
-};
-
-#endif
\ No newline at end of file