• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ RESTORE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中RESTORE函数的典型用法代码示例。如果您正苦于以下问题:C++ RESTORE函数的具体用法?C++ RESTORE怎么用?C++ RESTORE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了RESTORE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: arms_restore_state

int
arms_restore_state(arms_context_t *res, const char *state, size_t size)
{
	const struct arms_dumped_state *newstate;
	const struct dumped_rsinfo *rsinfo;
	MD5_CTX md5ctx;
	unsigned char digest[16];
	int i;

	/* check size */
	if (size < arms_size_of_state()) {
		return ARMS_ESIZE;
	}

	/* restore res from state array */
	newstate = (const struct arms_dumped_state *)state;
	MD5_Init(&md5ctx);
	MD5_Update(&md5ctx, newstate,
		  sizeof(*newstate) - sizeof(newstate->digest));
	MD5_Final(digest, &md5ctx);
	if (memcmp(digest, newstate->digest, sizeof(digest)) != 0) {
		/* digest is not valid, invalid state */
		return ARMS_EINVAL;
	}
	if (newstate->state_version != ARMS_STATE_VERSION) {
		/* version mismatch, cannot use state data. */
		return ARMS_EINVAL;
	}

	RESTORE(rs_endpoint);
	RESTORE(rs_preshared_key);
	/* acmi (RS list) */
	acmi_reset_server(res->acmi, ACMI_CONFIG_CONFSOL);
	for (i = 0; i < 5; i++) {
		rsinfo = &newstate->rsinfo[i];
		if (rsinfo->url[0] != '\0') {
			acmi_set_url(res->acmi, ACMI_CONFIG_CONFSOL,
				     rsinfo->url, URL_MAX_LEN, i);
			if (rsinfo->cert[0] == '\0')
				continue;
			acmi_set_cert(res->acmi, ACMI_CONFIG_CONFSOL,
				rsinfo->cert, strlen(rsinfo->cert) + 1, i);
		}
	}
	acmi_set_current_server(res->acmi,
				ACMI_CONFIG_CONFSOL, newstate->current_server);
	acmi_set_rmax(res->acmi, ACMI_CONFIG_CONFSOL, newstate->retry_max);
	acmi_set_rint(res->acmi, ACMI_CONFIG_CONFSOL, newstate->retry_int);
	acmi_set_lltimeout(res->acmi, ACMI_CONFIG_CONFSOL, newstate->lltimeout);
	acmi_put_lines(res->acmi, ACMI_CONFIG_CONFSOL,
		       newstate->line_defs, newstate->num_line);
	res->last_line = newstate->last_line;
	res->result = newstate->result;

#if defined(ARMS_DEBUG) && defined (DEBUG_ENABLE)
        acmi_dump(res->acmi);
#endif
	return 0;
}
开发者ID:centurysys,项目名称:libarms,代码行数:59,代码来源:cache.c


示例2: constraintSatIso

static int
constraintSatIso(pullTask *task, pullPoint *point,
                 double stepMax, unsigned int iterMax,
                 /* output */
                 int *constrFailP) {
  static const char me[]="constraintSatIso";
  double
    step,         /* current step size */
    val, aval,    /* last and current function values */
    hack,         /* how to control re-tries in the context of a single
                     for-loop, instead of a nested do-while loop */
    grad[4], dir[3], len, state[1 + 1 + 3 + 3];
  unsigned int iter = 0;  /* 0: initial probe, 1..iterMax: probes in loop */

  PROBE(val, aval, grad);
  SAVE(state, aval, val, grad, point->pos);
  hack = 1;
  for (iter=1; iter<=iterMax; iter++) {
    /* consider? http://en.wikipedia.org/wiki/Halley%27s_method */
    NORMALIZE(dir, grad, len);
    if (!len) {
      /* no gradient; back off */
      hack *= task->pctx->sysParm.backStepScale;
      RESTORE(aval, val, grad, point->pos, state);
      continue;
    }
    step = -val/len; /* the newton-raphson step */
    step = step > 0 ? AIR_MIN(stepMax, step) : AIR_MAX(-stepMax, step);
    ELL_3V_SCALE_INCR(point->pos, hack*step, dir);
    _pullPointHistAdd(point, pullCondConstraintSatA);
    PROBE(val, aval, grad);
    if (aval <= state[0]) {  /* we're no further from the root */
      if (AIR_ABS(step) < stepMax*task->pctx->sysParm.constraintStepMin) {
        /* we have converged! */
        break;
      }
      SAVE(state, aval, val, grad, point->pos);
      hack = 1;
    } else { /* oops, try again, don't update dir or len, reset val */
      hack *= task->pctx->sysParm.backStepScale;
      RESTORE(aval, val, grad, point->pos, state);
    }
  }
  if (iter > iterMax) {
    *constrFailP = pullConstraintFailIterMaxed;
  } else {
    *constrFailP = AIR_FALSE;
  }
  return 0;
}
开发者ID:CIBC-Internal,项目名称:teem,代码行数:50,代码来源:constraints.c


示例3: push_regs

/**
 * Copy the cached values of all @tracee's general purpose registers
 * back to the process, if necessary.  This function returns -errno if
 * an error occured, 0 otherwise.
 */
int push_regs(Tracee *tracee)
{
	int status;

	if (tracee->_regs_were_changed) {
		/* At the very end of a syscall, with regard to the
		 * entry, only the result register can be modified by
		 * PRoot.  */
		if (tracee->restore_original_regs) {
			/* Restore the sysarg register only if it is
			 * not the same as the result register.  Note:
			 * it's never the case on x86 architectures,
			 * so don't make this check, otherwise it
			 * would introduce useless complexity because
			 * of the multiple ABI support.  */
#if defined(ARCH_X86) || defined(ARCH_X86_64)
#    define		RESTORE(sysarg)	(REG(tracee, CURRENT, sysarg) = REG(tracee, ORIGINAL, sysarg))
#else
#    define	 	RESTORE(sysarg) (void) (reg_offset[SYSARG_RESULT] != reg_offset[sysarg] && \
				(REG(tracee, CURRENT, sysarg) = REG(tracee, ORIGINAL, sysarg)))
#endif

			RESTORE(SYSARG_NUM);
			RESTORE(SYSARG_1);
			RESTORE(SYSARG_2);
			RESTORE(SYSARG_3);
			RESTORE(SYSARG_4);
			RESTORE(SYSARG_5);
			RESTORE(SYSARG_6);
			RESTORE(STACK_POINTER);
		}

#if defined(ARCH_ARM64)
		struct iovec regs;

		regs.iov_base = &tracee->_regs[CURRENT];
		regs.iov_len  = sizeof(tracee->_regs[CURRENT]);

		status = ptrace(PTRACE_SETREGSET, tracee->pid, NT_PRSTATUS, &regs);
#else
#    if defined(ARCH_ARM_EABI)
		/* On ARM, a special ptrace request is required to
		 * change effectively the syscall number during a
		 * ptrace-stop.  */
		word_t current_sysnum = REG(tracee, CURRENT, SYSARG_NUM);
		if (current_sysnum != REG(tracee, ORIGINAL, SYSARG_NUM)) {
			status = ptrace(PTRACE_SET_SYSCALL, tracee->pid, 0, current_sysnum);
			if (status < 0)
				note(tracee, WARNING, SYSTEM, "can't set the syscall number");
		}
#    endif

		status = ptrace(PTRACE_SETREGS, tracee->pid, NULL, &tracee->_regs[CURRENT]);
#endif
		if (status < 0)
			return status;
	}

	return 0;
}
开发者ID:BobbWu,项目名称:PRoot,代码行数:65,代码来源:reg.c


示例4: Uequal

void Uequal ()
{                               /* equal */
  register AFFIX B = q->a;
  register AFFIX A = (q - 1)->a;
  affix x, y;
  char *csave = c;
  register char *xs = c, *ys;
  q -= 2;
  SAVE (x, A);
  SAVE (y, B);
  if (A == B)
  {
    CONTINUE;
  }
  else
  {
    if ((x.r == nil) && (x.l == nil))
      xs = x.t;
    else
    {
      sprinta (A);
      A->t = xs;
      A->l = nil;
      A->r = nil;
      *c++ = '\0';
    }
    ys = c;
    if ((y.r == nil) && (y.l == nil))
      ys = y.t;
    else
    {
      sprinta (B);
      B->t = ys;
      B->l = nil;
      B->r = nil;
      *c++ = '\0';
    }
    if (afxcmp (xs, ys) == 0)
    {
      CONTINUE;
    }
  }
  c = csave;
  RESTORE (A, x);
  RESTORE (B, y);
  (q + 1)->a = A;
  (q + 2)->a = B;
  (q + 3)->q = Uequal;
  q += 3;
}
开发者ID:glammar,项目名称:glammar,代码行数:50,代码来源:ge11.c


示例5: main

int main(int argc, char **argv)
{
    Akregator::AboutData about;
    KCmdLineArgs::init(argc, argv, &about);
    KCmdLineArgs::addCmdLineOptions(Akregator::akregator_options);
    KUniqueApplication::addCmdLineOptions();

    Akregator::Application app;

    // start knotifyclient if not already started. makes it work for people who doesn't use full kde, according to kmail devels
    KNotifyClient::startDaemon();

    // see if we are starting with session management
    if(app.isRestored())
    {
#undef RESTORE
#define RESTORE(type) { int n = 1;\
    while (KMainWindow::canBeRestored(n)){\
        (new type)->restore(n, false);\
            n++;}}

        RESTORE(Akregator::MainWindow);
    }

    return app.exec();
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:26,代码来源:main.cpp


示例6: main

int main(int argc, char **argv)
{
    KAboutData about("khipu", "gplacs", ki18n(I18N_NOOP("Khipu")), version, ki18n(description),
                     KAboutData::License_GPL, ki18n("(C) 2010-2012, Percy Camilo Triveño Aucahuasi"));

    about.addAuthor(ki18n("Percy Camilo Triveño Aucahuasi"), ki18n("Main developer"), "[email protected]");

    about.addCredit(ki18n("Punit Mehta"), ki18n("GSoC-2013 student - Persistance file support. Plot-dictionary support. Worked for application actions, command-line improvements and space filtering. Several bug fixings"), "[email protected]");
    about.addCredit(ki18n("Manuel Álvarez Blanco"), ki18n("Thesis mentor - Guide and supervision during project conception. Bibliographical support. Numeric Mathematics and Algorithms support"), "");
    about.addCredit(ki18n("José Ignacio Cuevas Gonzáles"), ki18n("Thesis mentor - Supervision, Product Guide, Product promotion and former Client"), "[email protected]");
    about.addCredit(ki18n("Eduardo Fernandini Capurro"), ki18n("Thesis mentor - Supervision, Bibliographical Support, Product Guide and former Client"), "[email protected]");
    about.addCredit(ki18n("Jaime Urbina Pereyra"), ki18n("Thesis mentor - Supervision and former Main Project Mentor"), "[email protected]");

    about.addCredit(ki18n("Aleix Pol Gonzalez"), ki18n("KAlgebra and Analitza parser author, both vitals for the project"));

    about.addCredit(ki18n("José Fernando Ramos Ramirez"), ki18n("First version of Famous Curves Database. Build former windows installer"), "[email protected]");
    about.addCredit(ki18n("Susan Pamela Rios Sarmiento"), ki18n("First version of Famous Curves Database"), "[email protected]");

    about.addCredit(ki18n("Edgar Velasquez"), ki18n("2D Improvements"));
    about.addCredit(ki18n("Jose Torres Cardenas"), ki18n("3D Improvements"));
    about.addCredit(ki18n("Elizabeth Portilla Flores"), ki18n("3D Improvements"));
    about.addCredit(ki18n("Paul Murat Landauro Minaya"), ki18n("3D Improvements"));

    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    options.add("+[URL]", ki18n( "A Khipu-file to open" ));
    KCmdLineArgs::addCmdLineOptions(options);

    KApplication app;

    MainWindow *mainWindow = new MainWindow;

    if (app.isSessionRestored()) {
        RESTORE(MainWindow)
    } else {
        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
        if (args->count() == 0) {
            mainWindow->checkforAutoSavedFile();
            mainWindow->show();
        } else {
            int i = 0;
            bool exit = false;
            for (; i < args->count(); i++) {
                if (i==0) {
                    if(args->arg(0)!="ignoreautosavedfile"){
                        if (!(mainWindow->openFile(args->url(0).path())))
                            exit = true;
                    }
                }
                mainWindow->show();
            }
            if (exit)
                mainWindow->deleteLater(); // can't open a khipu file, so just exit !
        }
        args->clear();
    }
    return app.exec();
}
开发者ID:KDE,项目名称:khipu,代码行数:59,代码来源:main.cpp


示例7: restore_material

material_t *
restore_material( void ) {
  material_t * m;
  RESTORE( m );
  RESTORE_STR( m->name );
  RESTORE_PTR( m->next );
  return m;
}
开发者ID:Tomyao,项目名称:vpic,代码行数:8,代码来源:material.c


示例8: underrunProtect

 NIns *Assembler::genEpilogue()
 {
     underrunProtect(12);
     RESTORE(G0, G0, G0); //restore
     JMPLI(I7, 8, G0); //ret
     ORI(O0, 0, I0);
     return  _nIns;
 }
开发者ID:Jeffxz,项目名称:nodeas,代码行数:8,代码来源:NativeSparc.cpp


示例9: sa11x0_pm_enter

static int sa11x0_pm_enter(suspend_state_t state)
{
	unsigned long gpio, sleep_save[SLEEP_SAVE_COUNT];

	gpio = GPLR;

	/* save vital registers */
	SAVE(GPDR);
	SAVE(GAFR);

	SAVE(PPDR);
	SAVE(PPSR);
	SAVE(PPAR);
	SAVE(PSDR);

	SAVE(Ser1SDCR0);

	/* Clear previous reset status */
	RCSR = RCSR_HWR | RCSR_SWR | RCSR_WDR | RCSR_SMR;

	/* set resume return address */
	PSPR = virt_to_phys(cpu_resume);

	/* go zzz */
	cpu_suspend(0, sa1100_finish_suspend);

	/*
	 * Ensure not to come back here if it wasn't intended
	 */
	PSPR = 0;

	/*
	 * Ensure interrupt sources are disabled; we will re-init
	 * the interrupt subsystem via the device manager.
	 */
	ICLR = 0;
	ICCR = 1;
	ICMR = 0;

	/* restore registers */
	RESTORE(GPDR);
	RESTORE(GAFR);

	RESTORE(PPDR);
	RESTORE(PPSR);
	RESTORE(PPAR);
	RESTORE(PSDR);

	RESTORE(Ser1SDCR0);

	GPSR = gpio;
	GPCR = ~gpio;

	/*
	 * Clear the peripheral sleep-hold bit.
	 */
	PSSR = PSSR_PH;

	return 0;
}
开发者ID:Jackeagle,项目名称:android_kernel_sony_c2305,代码行数:60,代码来源:pm.c


示例10: restore_grid

grid_t *
restore_grid( void ) {
  grid_t * g;
  RESTORE( g );
  if( g->range    ) RESTORE_ALIGNED( g->range );
  if( g->neighbor ) RESTORE_ALIGNED( g->neighbor );
  RESTORE_PTR( g->mp );
  return g;
}
开发者ID:Tomyao,项目名称:vpic,代码行数:9,代码来源:grid_structors.c


示例11: mvwcch

/**
 * mvwcch -- move the cursor and write a complex character and rendition
 * @win : pointer to a WINDOW
 * @y   : y-coordinate to write at
 * @x   : x-coordinate to write at
 * @wch : pointer to the wchar_t to be written
 * @attr: the desired window attributes
 * @pair: the desired color pair
 */
void mvwcch(WINDOW *win, int y, int x, const wchar_t *wch, attr_t attr, short pair)
{
        SAVEWIN(win);
        wattr_set(win, attr, pair, NULL);
        if (wch && (*wch != L'\0')) {
                mvwaddnwstr(win, y, x, wch, 1);
        }
        RESTORE(win);
}
开发者ID:linehan,项目名称:barnacle,代码行数:18,代码来源:gfx.c


示例12: main

int main ( int argc, char **argv ) {
  KAboutData about ( "kmilion", 0, ki18n ( "KMilion" ), version, ki18n ( description ),
                     KAboutData::License_GPL, ki18n ( "(C) 2010 Mikołaj Sochacki" ), KLocalizedString(), 0, "[email protected]" );
  about.addAuthor ( ki18n ( "Mikołaj Sochacki" ), KLocalizedString(), "[email protected]" );
  KCmdLineArgs::init ( argc, argv, &about );

  KCmdLineOptions options;
  options.add ( "+[URL]", ki18n ( "Document to open" ) );
  KCmdLineArgs::addCmdLineOptions ( options );
  KApplication app;
  
  KMilion *widget = new KMilion;
  const QRect r = app.desktop()->frameGeometry();
  widget->setScreenSize ( r.width(), r.height() );
  KCmdLineArgs *args;
  if ( app.isSessionRestored() ) {
      RESTORE ( KMilion );
    }
  else {
      args = KCmdLineArgs::parsedArgs();
      widget->show();
    }
  args->clear();

  // Tak jest w orginale nie mam pojęcia dlaczego? Szczególnie po co kilka razy show!
  //see if we are starting with session management
//     if (app.isSessionRestored())
//     {
//         RESTORE(KMilion);
//     }
//     else
//     {
//         // no session.. just start up normally
//         KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
//         if (args->count() == 0)
//         {
//             //kmilion *widget = new kmilion;
//             widget->show();
//         }
//         else
//         {
//             int i = 0;
//             for (; i < args->count(); i++)
//             {
//                 //kmilion *widget = new kmilion;
//                 widget->show();
//             }
//         }
//         args->clear();
//     }

  return app.exec();
}
开发者ID:mikolajs,项目名称:milionaire,代码行数:53,代码来源:main.cpp


示例13: main

int main(int argc, char *argv[])
{

    KAboutData aboutData( "kimagemapeditor", I18N_NOOP("KImageMapEditor"),
                          VERSION, description, KAboutData::License_GPL,
                          "(C) 2001-2008 Jan Schaefer", 0, "http://www.nongnu.org/kimagemap/", "[email protected]");
    aboutData.addAuthor("Jan Schaefer",0, "[email protected]");
    aboutData.addCredit("Joerg Jaspert",I18N_NOOP("For helping me with the Makefiles, and creating the Debian package"));
    aboutData.addCredit("Aaron Seigo and Michael",I18N_NOOP("For helping me fixing --enable-final mode"));
    aboutData.addCredit("Antonio Crevillen",I18N_NOOP("For the Spanish translation"));
    aboutData.addCredit("Fabrice Mous",I18N_NOOP("For the Dutch translation"));
    aboutData.addCredit("Germain Chazot",I18N_NOOP("For the French translation"));
    KCmdLineArgs::init( argc, argv, &aboutData );
    KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.

    KApplication a;
    a.dcopClient()->registerAs(a.name());



    if (a.isRestored())
    {
        RESTORE(KimeShell);
    }
    else
    {
        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
        if ( args->count() == 0 )
        {
            KimeShell *kimeShell = new KimeShell();
            kimeShell->setStdout(args->isSet("stdout"));
            kimeShell->readConfig();
            kimeShell->show();
            kimeShell->openLastFile();
        }
        else
        {
            int i = 0;
            for (; i < args->count(); i++ )
            {
                KimeShell *kimeShell = new KimeShell();
                kimeShell->setStdout(args->isSet("stdout"));
                kimeShell->readConfig();
                kimeShell->show();
                kimeShell->openFile(args->url(i));
            }
        }
        args->clear();
    }

    return a.exec();
}
开发者ID:serghei,项目名称:kde3-kdewebdev,代码行数:52,代码来源:main.cpp


示例14: kdemain

extern "C" KDE_EXPORT int kdemain (int argc, char *argv[]) {
    setsid ();

    KAboutData aboutData ("kmplayer", 0, ki18n("KMPlayer"),
            KMPLAYER_VERSION_STRING,
            ki18n ("Media player."),
            KAboutData::License_GPL,
            ki18n ("(c) 2002-2009, Koos Vriezen"),
            KLocalizedString(),
            I18N_NOOP ("http://kmplayer.kde.org"));
    aboutData.addAuthor(ki18n("Koos Vriezen"), ki18n("Maintainer"),"[email protected]");
    KCmdLineArgs::init (argc, argv, &aboutData);
    KCmdLineOptions options;
    options.add ("+[File]", ki18n ("file to open"));
    KCmdLineArgs::addCmdLineOptions (options);

    KMPlayer::Ids::init();

    KApplication app;
    QPointer <KMPlayerApp> kmplayer;

    if (app.isSessionRestored ()) {
        RESTORE (KMPlayerApp);
    } else {
        kmplayer = new KMPlayerApp ();
        kmplayer->show();

        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

        KUrl url;
        if (args->count () == 1)
            url = args->url (0);
        if (args->count () > 1)
            for (int i = 0; i < args->count (); i++) {
                KUrl url = args->url (i);
                if (url.url ().indexOf ("://") < 0)
                    url = KUrl (QFileInfo (url.url ()).absoluteFilePath ());
                if (url.isValid ())
                    kmplayer->addUrl (url);
            }
        kmplayer->openDocumentFile (url);
        args->clear ();
    }
    int retvalue = app.exec ();

    delete kmplayer;

    KMPlayer::Ids::reset();

    return retvalue;
}
开发者ID:KDE,项目名称:kmplayer,代码行数:51,代码来源:main.cpp


示例15: meta_import_pixel_state

static void meta_import_pixel_state(struct intel_context *intel)
{
   struct brw_context *brw = brw_context(&intel->ctx);
   
   RESTORE(brw, Color, _NEW_COLOR);
   RESTORE(brw, Depth, _NEW_DEPTH);
   RESTORE(brw, Fog, _NEW_FOG);
   RESTORE(brw, Scissor, _NEW_SCISSOR);
   RESTORE(brw, Stencil, _NEW_STENCIL);
   RESTORE(brw, Texture, _NEW_TEXTURE);
   RESTORE(brw, FragmentProgram, _NEW_PROGRAM);
}
开发者ID:astrofimov,项目名称:vgallium,代码行数:12,代码来源:brw_metaops.c


示例16: main

int main(int argc, char *argv[]) {
	KAboutData aboutData( "rkward", I18N_NOOP ("RKWard"), version, description, KAboutData::License_GPL, "(c) 2002, 2004, 2005, 2006", 0, "http://rkward.sf.net", "[email protected]");
	aboutData.addAuthor ("Thomas Friedrichsmeier", I18N_NOOP ("Project leader / main developer"), 0);
	aboutData.addAuthor ("Pierre Ecochard",  I18N_NOOP ("C++ coder since 0.2.9"), 0);
	aboutData.addCredit ("Contributors in alphabetical order", 0, 0);
	aboutData.addCredit ("Philippe Grosjean", I18N_NOOP ("Several helpful comments and discussions"), 0);
	aboutData.addCredit ("Adrien d'Hardemare", I18N_NOOP ("Plugins and patches"), 0);
	aboutData.addCredit ("Yves Jacolin", I18N_NOOP ("New website"), 0);
	aboutData.addCredit ("Prasenjit Kapat", I18N_NOOP ("Several plugins"), 0);
	aboutData.addCredit ("Marco Martin", I18N_NOOP ("A cool icon"), 0);
	aboutData.addCredit ("Daniele Medri", I18N_NOOP ("RKWard logo, many suggestions, help on wording"), 0);
	aboutData.addCredit ("Stefan Roediger", I18N_NOOP ("Many plugins, suggestions, marketing, translations"), 0);
	aboutData.addCredit ("David Sibai", I18N_NOOP ("Several valuable comments, hints and patches"), 0);
	aboutData.addCredit ("Ilias Soumpasis", I18N_NOOP ("Translation, Suggestions, plugins"), 0);
	aboutData.addCredit ("Ralf Tautenhahn", I18N_NOOP ("Many comments, useful suggestions, and bug reports"), 0);
	aboutData.addCredit ("Roland Vollgraf", I18N_NOOP ("Some patches"), 0);
	aboutData.addCredit (I18N_NOOP ("Many more people on [email protected]"), I18N_NOOP ("Sorry, if we forgot to list you. Please contact us to get added"), 0);

	// before initializing the commandline args, remove the ".bin" from "rkward.bin".
	// This is so it prints "Usage rkward..." instead of "Usage rkward.bin...", etc.
	// it seems safest to keep a copy, since the shell still owns argv[0]
	char *argv_zero_copy = argv[0];
	argv[0] = qstrdup (QString (argv_zero_copy).remove (".bin").local8Bit ());
	KCmdLineArgs::init( argc, argv, &aboutData );
	KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
	
	RKWardApplication app;
	if (app.isRestored ()) {
		RESTORE(RKWardMainWindow);	// well, whatever this is supposed to do -> TODO
	} else {
		KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
		RK_Debug_Level = 5 - QString (args->getOption ("debug-level")).toInt ();
		RK_Debug_Flags = QString (args->getOption ("debug-flags")).toInt (0, 2);
		qDebug ("Debug-flags as decimal: %d", RK_Debug_Flags);
		
		KURL *open_url = 0;
		if (args->count ()) {
			open_url = new KURL (args->makeURL (args->arg (0)));
		}
		args->clear();
		
		new RKWardMainWindow(open_url);
	}

	// do it!
	int status = app.exec ();
	// restore old argv[0] so the shell is happy
	argv[0] = argv_zero_copy;
	return status;
}
开发者ID:svn2github,项目名称:rkward-svn-mirror,代码行数:50,代码来源:main.cpp


示例17: main

int main(int argc, char **argv)
{
    KAboutData about("moviemanager", 0, ki18n("MovieManager"), version, ki18n(description),
                     KAboutData::License_GPL, ki18n("(C) 2012 Sandeep Raju P & Sadan Sohan M"), KLocalizedString(), 0, "[email protected]\[email protected]");
    about.addAuthor( ki18n("Sandeep Raju P"), KLocalizedString(), "[email protected]" );
    about.addAuthor( ki18n("Sadan Sohan M"), KLocalizedString(), "[email protected]" );
    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    options.add("+[URL]", ki18n( "Document to open" ));
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app;

    MovieManager *widget = new MovieManager();

    // see if we are starting with session management
    if (app.isSessionRestored())
    {
        RESTORE(MovieManager);
    }
    else
    {
        // no session.. just start up normally
        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
        if (args->count() == 0)
        {
            //moviemanager *widget = new moviemanager;
            //widget->setMaximumSize(200,200);
            widget->show();
            //mainListScroll->show();
           // widget->mainListScroll->show();

        }
        else
        {
            int i = 0;
            for (; i < args->count(); i++)
            {
                //moviemanager *widget = new moviemanager;
                //widget->setMaximumSize(200,200);
                widget->show();
                //widget->mainListScroll->show();
            }
        }
        args->clear();
    }

    return app.exec();
}
开发者ID:sandeepraju,项目名称:MovieManager,代码行数:49,代码来源:main.cpp


示例18: main

int main(int argc, char **argv)
{
	 KLocale::setMainCatalogue("kasablanca");	

    KAboutData about("kasablanca", I18N_NOOP("kasablanca"), version, description,
                     KAboutData::License_GPL, "(C) 2004 Magnus Kulke", 0, 0,
							"[email protected]");
    about.addAuthor( "Magnus Kulke", 0, "[email protected]" );
    about.addAuthor( "Big Biff", 0, "[email protected]" );
	 about.addCredit( "Stefan Bogner", 0, "[email protected]" );
	 about.addCredit( "Christoph Thielecke", 0, "[email protected]" );
	about.addCredit( "Richard Stellingwerf", 0, "[email protected]" );
    KCmdLineArgs::init(argc, argv, &about);
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app;

    // register ourselves as a dcop client
    app.dcopClient()->registerAs(app.name(), false);

    // see if we are starting with session management
    if (app.isRestored())
    {
        RESTORE(Kasablanca);
    }
    else
    {
        // no session.. just start up normally
        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
        if (args->count() == 0)
        {
            Kasablanca *widget = new Kasablanca;
            widget->show();
        }
        else
        {
            int i = 0;
            for (; i < args->count(); i++)
            {
                Kasablanca *widget = new Kasablanca;
                widget->show();
// TODO: Load the ftp url passed on the command line.
//                widget->load(args->url(i));
            }
        }
        args->clear();
    }

    return app.exec();
}
开发者ID:BackupTheBerlios,项目名称:kasablanca,代码行数:49,代码来源:main.cpp


示例19: main

int main(int argc, char **argv)
{
    KAboutData about("weather-desktop", 0,
                     ki18nc("@title", "Weather Desktop"), 			// Title
                     version,										// Version number
                     ki18nc("@title", description),					// Description
                     KAboutData::License_GPL_V3,						// License
                     ki18n("(C) 2013 Michael Spencer"),				// Copyright
                     ki18nc("@info", credits),						// Credits
                     "https://github.com/iBeliever/weather-desktop",	// Home page
                     "[email protected]"							// Bugs email address
                    );

    about.addAuthor(ki18nc("@info:credit", "Michael Spencer"),
                    ki18nc("@info:credit", "Maintainer, developer, and designer"),
                    "[email protected]", "http://ibeliever.github.io");
    about.addAuthor(ki18nc("@info:credit", "Christopher Spencer"),
                    ki18nc("@info:credit", "Designer"),
                    "[email protected]");


    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    KCmdLineArgs::addCmdLineOptions(options);
    Application app;
    App = &app;

    qDebug() << "Debugging is enabled.";

    // See if we are starting with session management
    if (app.isSessionRestored())
    {
        RESTORE(WeatherDesktop);
    }
    else
    {
        WeatherDesktop *mainWindow = new WeatherDesktop;
        mainWindow->show();

        // For debugging purposes
        //KMessageBox::informationList(mainWindow, "Command line arguments:", KCmdLineArgs::allArguments());
    }

    return app.exec();
}
开发者ID:sonrisesoftware,项目名称:weather-desktop,代码行数:46,代码来源:main.cpp


示例20: main

int main(int argc, char **argv)
{
    QApplication app(argc, argv);
    Kdelibs4ConfigMigrator migrate(QStringLiteral("kdiamond"));
    migrate.setConfigFiles(QStringList() << QStringLiteral("kdiamondrc") << QStringLiteral("kdiamond.notifyrc"));
    migrate.setUiFiles(QStringList() << QStringLiteral("kdiamondui.rc"));
    migrate.migrate();

    qsrand(time(0));
    KLocalizedString::setApplicationDomain("kdiamond");
    KAboutData about(QStringLiteral("kdiamond"), i18nc("The application's name", "KDiamond"), QLatin1Literal(version), i18n(description),
                     KAboutLicense::GPL, i18n("(C) 2008-2010 Stefan Majewsky and others"), QStringLiteral("http://games.kde.org/kdiamond"));
    about.addAuthor(i18n("Stefan Majewsky"), i18n("Original author and current maintainer"), QStringLiteral("[email protected]"));
    about.addAuthor(i18n("Paul Bunbury"), i18n("Gameplay refinement"), QStringLiteral("[email protected]"));
    about.addCredit(i18n("Eugene Trounev"), i18n("Default theme"), QStringLiteral("[email protected]"));
    about.addCredit(i18n("Felix Lemke"), i18n("Classic theme"), QStringLiteral("[email protected]"));
    about.addCredit(i18n("Jeffrey Kelling"), i18n("Technical consultant"), QStringLiteral("[email protected]"));
    QCommandLineParser parser;
    KAboutData::setApplicationData(about);
    KCrash::initialize();
    parser.addVersionOption();
    parser.addHelpOption();
    about.setupCommandLine(&parser);
    parser.process(app);
    about.processCommandLine(&parser);

    app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kdiamond")));

    //resource directory for KNewStuff2 (this call causes the directory to be created; its existence is necessary for the downloader)
    QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1String("/themes/");

    Kg::difficulty()->addStandardLevelRange(
        KgDifficultyLevel::VeryEasy,
        KgDifficultyLevel::VeryHard
    );
    KDBusService service;
    // see if we are starting with session management
    if (app.isSessionRestored()) {
        RESTORE(MainWindow);
    } else {
        MainWindow *window = new MainWindow;
        window->show();
    }
    return app.exec();
}
开发者ID:KDE,项目名称:kdiamond,代码行数:45,代码来源:main.cpp



注:本文中的RESTORE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ RES_COL_N函数代码示例发布时间:2022-05-30
下一篇:
C++ RESTARTABLE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap