diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-11-20 10:36:29 -0600 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-12-23 02:22:56 +0100 |
commit | 94067b20f46444eed62778026fd4cb532a8c263c (patch) | |
tree | 1fbb1db7c363f5c0e90862bce139cc051d1c1e44 /kdeprint | |
parent | a72da839c8137c4d1ca3d945fc314fca902cf366 (diff) | |
download | tdelibs-94067b20f46444eed62778026fd4cb532a8c263c.tar.gz tdelibs-94067b20f46444eed62778026fd4cb532a8c263c.zip |
Use compressed-ppd:<database name>:<ppd name> as compressed PPD URI
(cherry picked from commit cfa9446f2535a288f803412a996acb5dd741e8fb)
Diffstat (limited to 'kdeprint')
-rw-r--r-- | kdeprint/cups/make_driver_db_cups.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/kdeprint/cups/make_driver_db_cups.c b/kdeprint/cups/make_driver_db_cups.c index ce3435754..e15f052e2 100644 --- a/kdeprint/cups/make_driver_db_cups.c +++ b/kdeprint/cups/make_driver_db_cups.c @@ -164,7 +164,18 @@ void initPpd(const char *dirname) char * pos2 = strstr(pos1 + 1, "\""); if (pos2 >= 0) { *pos2 = 0; - addFile(line+1, dirname); + char * pos3 = strstr(pos1 + 1, ":"); + if (pos3 >= 0) { + char *ppduri; + int n2 = strlen("compressed-ppd:")+strlen(pos3+1); + ppduri = (char*)malloc(n2*sizeof(char)+1); + memset(ppduri,0,n2); + strcat(ppduri, "compressed-ppd:"); + strcat(ppduri, pos3+1); + addFile(ppduri, dirname); + free(ppduri); + ppduri = NULL; + } } } } @@ -232,7 +243,7 @@ int parseCompressedPpdFile(const char *ppdfilename, const char *origin, FILE *ou size_t len = 0; ssize_t read; - fprintf(output_file,"FILE=foomatic-db-compressed-ppds:%s\n",ppdfilename); + fprintf(output_file,"FILE=compressed-ppd:%s:%s\n", origin, ppdfilename); while ((read = getline(&line, &len, file)) != -1) { PROCESS_PPD_FILE_CONTENTS @@ -257,7 +268,7 @@ int parseCompressedPpdFile(const char *ppdfilename, const char *origin, FILE *ou int main(int argc, char *argv[]) { registerHandler("ppd:", initPpd, parsePpdFile); - registerHandler("foomatic-db-compressed-ppds:", initPpd, parseCompressedPpdFile); + registerHandler("compressed-ppd:", initPpd, parseCompressedPpdFile); initFoomatic(); return execute(argc, argv); } |