Ignore:
Timestamp:
Sep 19, 2018 5:00:17 PM (23 months ago)
Author:
meeh <meeh@…>
Branches:
master
Children:
0f8a618
Parents:
802115e
Message:

Cleaning up the code base, remove dead code and failed attempts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • launchers/macosx/AppDelegate.h

    r802115e re046418f  
    55#include <string.h>
    66#include <memory.h>
     7
     8#ifdef __cplusplus
     9#include <unistd.h>
     10#include <sys/types.h>
     11#include <pwd.h>
     12#include <assert.h>
     13#endif
    714
    815#include <Cocoa/Cocoa.h>
     
    3643@property (copy) NSString* jarFile;
    3744@end
     45
     46
    3847#ifdef __cplusplus
    39 #include "JavaHelper.h"
     48
     49inline const char* RealHomeDirectory() {
     50  struct passwd *pw = getpwuid(getuid());
     51  assert(pw);
     52  return pw->pw_dir;
     53}
     54
     55inline std::string getDefaultBaseDir()
     56{
     57  // Figure out base directory
     58  auto homeDir = RealHomeDirectory();
     59  const char* pathFromHome = "%s/Library/I2P";
     60  char buffer[strlen(homeDir)+strlen(pathFromHome)];
     61  sprintf(buffer, pathFromHome, homeDir);
     62  std::string i2pBaseDir(buffer);
     63  return i2pBaseDir;
     64}
    4065
    4166inline void sendUserNotification(NSString* title, NSString* informativeText, NSImage* contentImage = NULL, bool makeSound = false) {
Note: See TracChangeset for help on using the changeset viewer.