mirror of
https://github.com/chris2511/xca.git
synced 2026-09-12 19:51:05 +05:00
set sane start dir for PKCS#11 lib selection
This commit is contained in:
parent
6902307c32
commit
9924d39668
16
lib/func.cpp
16
lib/func.cpp
@ -111,6 +111,22 @@ QString getHomeDir()
|
||||
return hd;
|
||||
}
|
||||
|
||||
QString getLibDir()
|
||||
{
|
||||
QString hd;
|
||||
#ifdef WIN32
|
||||
LPITEMIDLIST pidl = NULL;
|
||||
TCHAR buf[255] = "";
|
||||
if (SUCCEEDED(SHGetSpecialFolderLocation(NULL, CSIDL_SYSTEM, &pidl))) {
|
||||
SHGetPathFromIDList(pidl, buf);
|
||||
}
|
||||
hd = buf;
|
||||
#else
|
||||
hd = QString("/usr/lib");
|
||||
#endif
|
||||
return hd;
|
||||
}
|
||||
|
||||
QString getDocDir()
|
||||
{
|
||||
#if defined(WIN32) || defined (Q_WS_MAC)
|
||||
|
||||
@ -18,6 +18,7 @@ class Validity;
|
||||
QPixmap *loadImg(const char *name);
|
||||
QString getPrefix();
|
||||
QString getHomeDir();
|
||||
QString getLibDir();
|
||||
QString getDocDir();
|
||||
QString getUserSettingsDir();
|
||||
QString getFullFilename(const QString &filename, const QString &selectedFilter);
|
||||
|
||||
@ -13,5 +13,6 @@ Makefile.qt: macdeployqt.pro
|
||||
|
||||
clean:
|
||||
rm -f *.o Makefile.qt macdeployqt
|
||||
distclean: clean
|
||||
|
||||
include $(TOPDIR)/Local.mak
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
#include "lib/func.h"
|
||||
#include "Options.h"
|
||||
#include "lib/pki_scard.h"
|
||||
#include <openssl/objects.h>
|
||||
@ -81,7 +82,7 @@ void Options::on_addButton_clicked(void)
|
||||
QString fname, status;
|
||||
|
||||
fname = QFileDialog::getOpenFileName(this, l.caption,
|
||||
QString(), l.filter);
|
||||
getLibDir(), l.filter);
|
||||
|
||||
if (fname.isEmpty() || pkcs11::get_lib(fname))
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user