mirror of
https://github.com/benapetr/stikkit.git
synced 2025-04-26 13:01:08 -05:00
Merge branch 'master' into ubuntu
This commit is contained in:
commit
adc19767b8
@ -24,7 +24,7 @@ string Configuration::URL = "";
|
|||||||
string Configuration::Expiry = "60";
|
string Configuration::Expiry = "60";
|
||||||
bool Configuration::Private = false;
|
bool Configuration::Private = false;
|
||||||
string Configuration::Author = "";
|
string Configuration::Author = "";
|
||||||
string Configuration::Version = "1.0.2";
|
string Configuration::Version = "1.0.3";
|
||||||
string Configuration::Title = "";
|
string Configuration::Title = "";
|
||||||
string Configuration::Home = "";
|
string Configuration::Home = "";
|
||||||
string Configuration::DefaultURL = "";
|
string Configuration::DefaultURL = "";
|
||||||
@ -60,6 +60,11 @@ void Configuration::Init()
|
|||||||
}
|
}
|
||||||
f.close();
|
f.close();
|
||||||
}
|
}
|
||||||
|
if (Configuration::Author.length() < 1)
|
||||||
|
{
|
||||||
|
// we don't have any author here! let's get it from passwd
|
||||||
|
Configuration::Author = pw->pw_name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::Store()
|
void Configuration::Store()
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unistd.h>
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include "configuration.hpp"
|
#include "configuration.hpp"
|
||||||
#include "terminalparser.hpp"
|
#include "terminalparser.hpp"
|
||||||
@ -36,17 +35,10 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
delete t;
|
delete t;
|
||||||
if (!Stikkit::Configuration::Author.length())
|
if (!Stikkit::Configuration::Author.length())
|
||||||
{
|
|
||||||
char buffer[200];
|
|
||||||
if (getlogin_r(buffer, 200))
|
|
||||||
{
|
|
||||||
Stikkit::Configuration::Author = buffer;
|
|
||||||
} else
|
|
||||||
{
|
{
|
||||||
// we need to provide some author name otherwise stikked will not display anything or some random characters there
|
// we need to provide some author name otherwise stikked will not display anything or some random characters there
|
||||||
Stikkit::Configuration::Author = "Unknown";
|
Stikkit::Configuration::Author = "Unknown";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!Stikkit::Configuration::URL.length())
|
if (!Stikkit::Configuration::URL.length())
|
||||||
{
|
{
|
||||||
if (Stikkit::Configuration::DefaultURL.length() > 0)
|
if (Stikkit::Configuration::DefaultURL.length() > 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user