mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 11:06:00 +08:00
Move ProfilesSharingUtils to backend (to libslic3r from GUI)
This commit is contained in:
parent
02b65b2366
commit
5f5147377e
@ -61,11 +61,10 @@
|
|||||||
#include "libslic3r/Utils.hpp"
|
#include "libslic3r/Utils.hpp"
|
||||||
#include "libslic3r/Thread.hpp"
|
#include "libslic3r/Thread.hpp"
|
||||||
#include "libslic3r/BlacklistedLibraryCheck.hpp"
|
#include "libslic3r/BlacklistedLibraryCheck.hpp"
|
||||||
|
#include "libslic3r/ProfilesSharingUtils.hpp"
|
||||||
|
|
||||||
#include "PrusaSlicer.hpp"
|
#include "PrusaSlicer.hpp"
|
||||||
|
|
||||||
#include "slic3r/Utils/ProfilesSharingUtils.hpp"
|
|
||||||
|
|
||||||
#ifdef SLIC3R_GUI
|
#ifdef SLIC3R_GUI
|
||||||
#include "slic3r/GUI/GUI_Init.hpp"
|
#include "slic3r/GUI/GUI_Init.hpp"
|
||||||
#endif /* SLIC3R_GUI */
|
#endif /* SLIC3R_GUI */
|
||||||
|
@ -508,8 +508,16 @@ set(SLIC3R_SOURCES
|
|||||||
Arachne/WallToolPaths.hpp
|
Arachne/WallToolPaths.hpp
|
||||||
Arachne/WallToolPaths.cpp
|
Arachne/WallToolPaths.cpp
|
||||||
StaticMap.hpp
|
StaticMap.hpp
|
||||||
|
ProfilesSharingUtils.hpp
|
||||||
|
ProfilesSharingUtils.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
list(APPEND SLIC3R_SOURCES
|
||||||
|
MacUtils.mm
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
add_library(libslic3r STATIC ${SLIC3R_SOURCES})
|
add_library(libslic3r STATIC ${SLIC3R_SOURCES})
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
17
src/libslic3r/MacUtils.mm
Normal file
17
src/libslic3r/MacUtils.mm
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#import "ProfilesSharingUtils.hpp"
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
namespace Slic3r {
|
||||||
|
|
||||||
|
// ProfilesSharingUtils.hpp
|
||||||
|
std::string GetDataDir()
|
||||||
|
{
|
||||||
|
NSURL* url = [[NSFileManager defaultManager] URLForDirectory:NSApplicationSupportDirectory
|
||||||
|
inDomain:NSUserDomainMask
|
||||||
|
appropriateForURL:nil create:NO error:nil];
|
||||||
|
|
||||||
|
return std::string([(CFStringRef)url.path UTF8String]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -3,10 +3,10 @@
|
|||||||
///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
||||||
///|/
|
///|/
|
||||||
#include "ProfilesSharingUtils.hpp"
|
#include "ProfilesSharingUtils.hpp"
|
||||||
#include "libslic3r/Utils.hpp"
|
#include "Utils.hpp"
|
||||||
#include "libslic3r/format.hpp"
|
#include "format.hpp"
|
||||||
#include "libslic3r/PrintConfig.hpp"
|
#include "PrintConfig.hpp"
|
||||||
#include "libslic3r/PresetBundle.hpp"
|
#include "PresetBundle.hpp"
|
||||||
|
|
||||||
#include <boost/property_tree/json_parser.hpp>
|
#include <boost/property_tree/json_parser.hpp>
|
||||||
|
|
@ -335,8 +335,6 @@ set(SLIC3R_GUI_SOURCES
|
|||||||
Utils/WxFontUtils.hpp
|
Utils/WxFontUtils.hpp
|
||||||
Utils/WifiScanner.hpp
|
Utils/WifiScanner.hpp
|
||||||
Utils/WifiScanner.cpp
|
Utils/WifiScanner.cpp
|
||||||
Utils/ProfilesSharingUtils.hpp
|
|
||||||
Utils/ProfilesSharingUtils.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
find_package(NanoSVG REQUIRED)
|
find_package(NanoSVG REQUIRED)
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#import "AppUpdater.hpp"
|
#import "AppUpdater.hpp"
|
||||||
#import "ProfilesSharingUtils.hpp"
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
@ -17,14 +16,4 @@ std::string get_downloads_path_mac()
|
|||||||
//return std::string();
|
//return std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProfilesSharingUtils.hpp
|
|
||||||
std::string GetDataDir()
|
|
||||||
{
|
|
||||||
NSURL* url = [[NSFileManager defaultManager] URLForDirectory:NSApplicationSupportDirectory
|
|
||||||
inDomain:NSUserDomainMask
|
|
||||||
appropriateForURL:nil create:NO error:nil];
|
|
||||||
|
|
||||||
return std::string([(CFStringRef)url.path UTF8String]);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user